Skip to content

Instantly share code, notes, and snippets.

@subhaze
Created April 12, 2016 18:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save subhaze/32c5c7f722738f5f07070da5ba801320 to your computer and use it in GitHub Desktop.
Save subhaze/32c5c7f722738f5f07070da5ba801320 to your computer and use it in GitHub Desktop.
function to get completions for sublime projects available and open said project in sublime
# Sublime text project completions
function sublp(){
subl --project ~/Sites/**/${1}.sublime-project
}
_sublp()
{
local cur=${COMP_WORDS[COMP_CWORD]}
local list=`ls -1 ~/Sites/**/*sublime-project | cut -d/ -f5`
COMPREPLY=( $(compgen -W "${list}" -- ${cur}) )
}
complete -F _sublp sublp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment