Skip to content

Instantly share code, notes, and snippets.

@manutter51
Created May 19, 2013 15:32
Show Gist options
  • Save manutter51/5608004 to your computer and use it in GitHub Desktop.
Save manutter51/5608004 to your computer and use it in GitHub Desktop.
Cygwin command line helper for Sublime Text 2
#!/bin/bash
### INSTALLATION:
### Add the following 4 lines to your .bashrc or .bash_profile
### # source the sublimerc file if it exists
### if [ -f "${HOME}/.sublimerc" ] ; then
### source "${HOME}/.sublimerc"
### fi
###
### Strip off the leading "### " of course.
# Edit this so your path includes the path to Sublime Text
export PATH="$PATH:/cygdrive/c/Program Files/Sublime Text 2/"
### You should not need to edit anything below this line
export SUBLIME_EXE="sublime_text.exe"
subfn() {
tu=""
for t in $@ ; do
tu="$tu `cygpath --windows $t`" ;
done
$SUBLIME_EXE $tu 2>&1 >>~/.sublime.log &
}
alias sub=subfn
echo "Sublime Text 2 available as 'sub <filename(s)>' command."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment