mirror of
https://github.com/zsh-users/zsh-completions.git
synced 2026-09-17 16:00:19 +00:00
Having a vim modeline or emacs local variable line somewhere in the middle of the file isn't really helpful. By default, vim will only check the first and last 5 lines of a file for a modeline (assuming the modeline option is enabled). Emacs is even more strict about the type of local variable line that was in use, it will only check the first line of the file or the second line if the first line specifies a script interpreter (which isn't the case here). Move the vim modeline to the end of the file so that it can actually be found by vim but is out of the way for editing. For emacs more work is required, convert that to the more verbose Local Variables syntax which emacs will look for starting 3000 characters from the end of the file. Also there is no zsh mode for emacs (according to zsh-users/zsh-completions#75), use the "Shell-Script" mode instead. This seems to automatically detect that the files are for zsh. I'm not an emacs user, so I haven't tested that portion much. But, this does at least improve the syntax highlighting there.
61 lines
1.6 KiB
Bash
61 lines
1.6 KiB
Bash
#compdef tmuxinator mux
|
|
# ------------------------------------------------------------------------------
|
|
# Description
|
|
# -----------
|
|
#
|
|
# Completion script for tmuxinator (https://github.com/aziz/tmuxinator).
|
|
#
|
|
# Source: https://gist.github.com/2242920
|
|
#
|
|
# ------------------------------------------------------------------------------
|
|
# Authors
|
|
# -------
|
|
#
|
|
# * ser1zw (https://github.com/ser1zw)
|
|
# * Ben O'Hara (https://github.com/benohara)
|
|
#
|
|
# ------------------------------------------------------------------------------
|
|
|
|
_tmuxinator() {
|
|
local -a projects
|
|
projects=(`find $HOME/.tmuxinator/ -name \*.yml| awk -F/ '{print $NF}' | sed s:.yml::g`)
|
|
|
|
local -a commands
|
|
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
|
|
copy|delete|open|start)
|
|
_arguments '*:projects:($projects)'
|
|
;;
|
|
list)
|
|
_arguments '-v[verbose]' # FIXME: doesn't work well
|
|
;;
|
|
esac
|
|
fi
|
|
|
|
return 0
|
|
}
|
|
|
|
_tmuxinator
|
|
|
|
# Local Variables:
|
|
# mode: Shell-Script
|
|
# sh-indentation: 2
|
|
# indent-tabs-mode: nil
|
|
# sh-basic-offset: 2
|
|
# End:
|
|
# vim: ft=zsh sw=2 ts=2 et
|