Skip to content

Instantly share code, notes, and snippets.

@indirect
Created March 7, 2010 06:12
Show Gist options
  • Save indirect/324208 to your computer and use it in GitHub Desktop.
Save indirect/324208 to your computer and use it in GitHub Desktop.
super-powered mate
# Enhanced mate command that can open and tab-complete tmproj files in ~/.tmproj
# To use, save your TM projects as ~/.tmproj/foo.tmproj, then open with `mate foo`
function mate {
if [ -a "$(cd ~/.tmproj; pwd)/$1.tmproj" ]; then
open "$(cd ~/.tmproj; pwd)/$1.tmproj"
else
/usr/bin/env mate "$1"
fi
}
complete -f -W '$(ls ~/.tmproj | sed s/.tmproj//)' mate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment