feat: add autocomplete to fx command

This commit is contained in:
max_richter 2021-07-04 15:54:39 +02:00
parent e42c80e553
commit 26cb75bb2f
3 changed files with 31 additions and 0 deletions

19
completions/_fx Executable file
View File

@ -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 "$@"

10
completions/init.zsh Normal file
View File

@ -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

View File

@ -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