improve tmuxp load completions

1. Limit wildcard json/yaml file matches to current directory
2. Preserve all directory completion (for tabbing into directories)
3. Use unlimited depth search for directories with .tmuxp.(yaml/json)
   inside them. tmuxp load command can load the file or the directory.
This commit is contained in:
Tony Narlock 2017-12-23 11:04:09 -06:00
parent 70a7a5cdee
commit 4508695cb2
1 changed files with 2 additions and 1 deletions

View File

@ -101,7 +101,8 @@ __tmuxp_load() {
local s
_alternative \
'sessions-user:user session:compadd -F line - ~/.tmuxp/*.(json|yml|yaml)(:r:t)' \
'sessions-other:session in current directory:_path_files -g "**/*.(json|yaml|yml)(-.)"'
'sessions-other:session in current directory:_path_files -/ -g "**/.tmuxp.(yml|yaml|json)"' \
'sessions-other:session in current directory:_path_files -g "*.(yml|yaml|json)"'
;;
esac
}