-
-
Save cmalard/16c58869319c9a88473ec08cc7989c6b to your computer and use it in GitHub Desktop.
Cygwin + Sublime Text 3 : works with files and Git
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 | |
# To create in [.babun/]cygwin/usr/local/bin/subl with chmod +x | |
ARGS="" | |
while test $# -gt 0 | |
do | |
ARGS="$ARGS ${1#/cygdrive/[a-zA-Z]}"; # Remove /cygdrive and disk letter from the path | |
shift | |
done | |
/cygdrive/c/Program\ Files/Sublime\ Text\ 3/subl.exe $ARGS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks @cmalard, It works good for
git
commands such asgit rebase -i HEAD~3
,but when I try to open a file,
e.g.
subl ~/.zshrc
, it opens in the wrong path:Expected:
C:\cygwin64\home\myuser\.zshrc
Actual (wrong):
C:\home\myuser\.zshrc
Another example:
subl /usr/local/bin/test
Expected:
C:\cygwin64\usr\local\bin\test
Actual (wrong):
C:\usr\local\bin\test