diff --git a/completions/_fx b/completions/_fx new file mode 100755 index 0000000..fe832a9 --- /dev/null +++ b/completions/_fx @@ -0,0 +1,19 @@ +#compdef fx + +_fx(){ + + local state + + _arguments \ + '1: :->action'\ + '*: :->folder_name' + + case $state in + (action) _arguments '1:profiles:(s i o)' ;; + (*) compadd "$@" $(echo $(ls ~/SYNC) | tr \\n ' ') + + esac + +} + +_fx "$@" diff --git a/completions/init.zsh b/completions/init.zsh new file mode 100644 index 0000000..7da277d --- /dev/null +++ b/completions/init.zsh @@ -0,0 +1,10 @@ +if isInstalled "deno"; then + mkdir -p ~/.oh-my-zsh/custom/plugins/deno + deno completions zsh > ~/.oh-my-zsh/custom/plugins/deno/_deno +fi + + +compdef _fx fx; +autoload -U compinit +compinit + diff --git a/configs/.zshrc b/configs/.zshrc index 001c0d8..7a55d6f 100644 --- a/configs/.zshrc +++ b/configs/.zshrc @@ -12,6 +12,8 @@ plugins=( eval `dircolors ~/.dircolors` +export FPATH=$FPATH:~/.dotfiles/completions + # Load oh my zsh export ZSH=~/.oh-my-zsh source $ZSH/oh-my-zsh.sh