Mercurial > dotfiles
changeset 372:c4b8f894bff1
Add tmuxinator completions for fish.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Thu, 16 Feb 2017 21:50:47 -0800 |
parents | 93a174c912ea |
children | 083360925deb |
files | fish/completions/tmuxinator.fish |
diffstat | 1 files changed, 24 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fish/completions/tmuxinator.fish Thu Feb 16 21:50:47 2017 -0800 @@ -0,0 +1,24 @@ +function __fish_tmuxinator_using_command + set cmd (commandline -opc) + if [ (count $cmd) -gt 1 ] + if [ $argv[1] = $cmd[2] ] + return 0 + end + end + return 1 +end + +set __fish_tmuxinator_program_cmd (commandline -o)[1] + +function __fish_tmuxinator_program + eval "$__fish_tmuxinator_program_cmd $argv" +end + +complete -f -c $__fish_tmuxinator_program_cmd -a '(__fish_tmuxinator_program completions start)' +complete -f -c $__fish_tmuxinator_program_cmd -n '__fish_use_subcommand' -x -a "(__fish_tmuxinator_program commands)" +complete -f -c $__fish_tmuxinator_program_cmd -n '__fish_tmuxinator_using_command start' -a "(__fish_tmuxinator_program completions start)" +complete -f -c $__fish_tmuxinator_program_cmd -n '__fish_tmuxinator_using_command open' -a "(__fish_tmuxinator_program completions open)" +complete -f -c $__fish_tmuxinator_program_cmd -n '__fish_tmuxinator_using_command copy' -a "(__fish_tmuxinator_program completions copy)" +complete -f -c $__fish_tmuxinator_program_cmd -n '__fish_tmuxinator_using_command delete' -a "(__fish_tmuxinator_program completions delete)" + +abbr --add mux "tmuxinator"