summaryrefslogtreecommitdiff
path: root/plugins/tmuxinator
diff options
context:
space:
mode:
authorTuowen Zhao <ztuowen@gmail.com>2018-07-11 10:39:25 -0700
committerTuowen Zhao <ztuowen@gmail.com>2018-07-11 10:39:25 -0700
commit852e7fe005267f74f3c04a4ddbb310522eee8014 (patch)
tree73e9f36d8bdcc979d7499580505738074e5a1dc9 /plugins/tmuxinator
parent59e91cd97fcc3c406751f019215f957b36614022 (diff)
parent7cb5fa8aea3d325fee08e3c1708abd12cdea1c1c (diff)
downloadzsh-852e7fe005267f74f3c04a4ddbb310522eee8014.tar.gz
zsh-852e7fe005267f74f3c04a4ddbb310522eee8014.tar.bz2
zsh-852e7fe005267f74f3c04a4ddbb310522eee8014.zip
Merge branch 'master' of https://github.com/robbyrussell/oh-my-zsh
Diffstat (limited to 'plugins/tmuxinator')
-rw-r--r--plugins/tmuxinator/_tmuxinator55
-rw-r--r--plugins/tmuxinator/tmuxinator.plugin.zsh5
2 files changed, 23 insertions, 37 deletions
diff --git a/plugins/tmuxinator/_tmuxinator b/plugins/tmuxinator/_tmuxinator
index 551267ed2..37032f8d8 100644
--- a/plugins/tmuxinator/_tmuxinator
+++ b/plugins/tmuxinator/_tmuxinator
@@ -1,40 +1,21 @@
-#compdef tmuxinator mux
-#autoload
+_tmuxinator() {
+ local commands projects
+ commands=(${(f)"$(tmuxinator commands zsh)"})
+ projects=(${(f)"$(tmuxinator completions start)"})
-local curcontext="$curcontext" state line ret=1
-local -a _configs
-
-_arguments -C \
- '1: :->cmds' \
- '2:: :->args' && ret=0
-
-_configs=(${$(echo ~/.tmuxinator/*.yml):r:t})
-
-case $state in
- cmds)
- _values "tmuxinator command" \
- "new[create a new project file and open it in your editor]" \
- "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]" \
- "debug[output the shell commands generated by a projet]" \
- "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]" \
- $_configs
- ret=0
- ;;
- args)
- case $line[1] in
- start|open|copy|delete|debug)
- [[ -n "$_configs" ]] && _values 'configs' $_configs
- ret=0
- ;;
+ if (( CURRENT == 2 )); then
+ _describe -t commands "tmuxinator subcommands" commands
+ _describe -t projects "tmuxinator projects" projects
+ elif (( CURRENT == 3)); then
+ case $words[2] in
+ copy|debug|delete|open|start)
+ _arguments '*:projects:($projects)'
+ ;;
esac
- ;;
-esac
+ fi
+
+ return
+}
-return ret
+compdef _tmuxinator tmuxinator mux
+alias mux="tmuxinator"
diff --git a/plugins/tmuxinator/tmuxinator.plugin.zsh b/plugins/tmuxinator/tmuxinator.plugin.zsh
new file mode 100644
index 000000000..166fa9881
--- /dev/null
+++ b/plugins/tmuxinator/tmuxinator.plugin.zsh
@@ -0,0 +1,5 @@
+# aliases
+alias txs='tmuxinator start'
+alias txo='tmuxinator open'
+alias txn='tmuxinator new'
+alias txl='tmuxinator list'