Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
zsh completion for tmuxinator
#compdef tmuxinator mux
# zsh completion for tmuxinator
# Install:
# $ mkdir -p ~/.tmuxinator/completion
# $ cp _tmuxinator ~/.tmuxinator/completion
# $ vi ~/.zshrc # add the following codes
# fpath=($HOME/.tmuxinator/completion ${fpath})
# autoload -U compinit
# compinit
_tmuxinator() {
local -a projects
projects=(`find ~/.tmuxinator/ -name \*.yml | cut -d/ -f5 | sed s:.yml::g`)
local -a commands
'start:start a tmux session using project'\''s tmuxinator config'
'open:create a new project file and open it in your editor'
'copy:copy source_project project file to a new project called new_project'
'delete:deletes the project called project_name'
'implode:deletes all existing projects!'
'list:list all existing projects'
'doctor:look for problems in your configuration'
'help:shows this help document'
'version:shows tmuxinator version number'
if (( CURRENT == 2 )); then
_describe -t commands 'commands' commands
elif (( CURRENT == 3 )); then
case $words[2] in
_arguments '*:projects:($projects)'
_arguments '-v[verbose]' # FIXME: doesn't work well
return 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment