Created
June 7, 2012 16:15
-
-
Save rahim/2889809 to your computer and use it in GitHub Desktop.
Open sublime on windows (+cygwin) from remote with same dir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# placed in .bashrc | |
function sb { | |
# TODO: do something to deal with paths that don't match shared workspace | |
# perhaps open in vim? or prompt to open in vim? | |
local FULLPATH=`readlink -f $1` | |
local HOMEPATH=~ #/home/AHC/rahim.packirsaibo | |
local HOMECHAR='~' | |
local REPLACED_PATH=${FULLPATH/$HOMEPATH/$HOMECHAR} | |
echo $REPLACED_PATH | |
ssh laptop33 '~/bin/sb' $REPLACED_PATH & | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# placed in PATH as sb | |
function sb { | |
local ORIG=$1 | |
# turn relative path to absolute | |
local UNIXPATH=`cygpath -a $ORIG` | |
# turn full path to win path | |
local WINPATH=`cygpath --dos $UNIXPATH` | |
~/Apps/Sublime\ Text\ 2\ Build\ 2181\ x64/sublime_text.exe $WINPATH & | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment