-
-
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 |
@cmalard this worked beautifully! Much obliged for this!
Thanks @cmalard, It works good for git
commands such as git 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I ran into this same strange thing, probably because it is used by Cygwin.
What you can do: delete the old file, then you can create it again.