feat: add autocomplete to fx command
This commit is contained in:
parent
e42c80e553
commit
26cb75bb2f
19
completions/_fx
Executable file
19
completions/_fx
Executable 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
10
completions/init.zsh
Normal 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
|
||||||
|
|
@ -12,6 +12,8 @@ plugins=(
|
|||||||
|
|
||||||
eval `dircolors ~/.dircolors`
|
eval `dircolors ~/.dircolors`
|
||||||
|
|
||||||
|
export FPATH=$FPATH:~/.dotfiles/completions
|
||||||
|
|
||||||
# Load oh my zsh
|
# Load oh my zsh
|
||||||
export ZSH=~/.oh-my-zsh
|
export ZSH=~/.oh-my-zsh
|
||||||
source $ZSH/oh-my-zsh.sh
|
source $ZSH/oh-my-zsh.sh
|
||||||
|
Loading…
Reference in New Issue
Block a user