diff --git a/dot_zsh/scw-completion.zsh b/dot_zsh/scw-completion.zsh new file mode 100644 index 0000000..748d4b4 --- /dev/null +++ b/dot_zsh/scw-completion.zsh @@ -0,0 +1,9 @@ +_scw () { + output=($(scw autocomplete complete zsh -- ${CURRENT} ${words})) + opts=('-S' ' ') + if [[ $output == *= ]]; then + opts=('-S' '') + fi + compadd "${opts[@]}" -- "${output[@]}" +} +compdef _scw scw diff --git a/dot_zshrc.tmpl b/dot_zshrc.tmpl index 9546953..a786e9b 100644 --- a/dot_zshrc.tmpl +++ b/dot_zshrc.tmpl @@ -40,6 +40,7 @@ source ~/.zsh/functions source ~/.zsh/exports source ~/.zsh/dstask-completion.zsh source ~/.zsh/fzf-completion.zsh +source ~/.zsh/scw-completion.zsh {{- if eq .chezmoi.hostname "taupo" }} source ~/.zsh/aliases_taupo