added completions to yash jump script
This commit is contained in:
parent
d7eabb19a8
commit
7cfe2b103e
1 changed files with 16 additions and 0 deletions
16
yash/z.sh
16
yash/z.sh
|
@ -5,6 +5,22 @@ _z_exec() {
|
||||||
return $?
|
return $?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function completion/z {
|
||||||
|
OPTIONS=( #>#
|
||||||
|
"h:; show help text"
|
||||||
|
"l:; list aliases"
|
||||||
|
"a:; add a new alias"
|
||||||
|
"r:; remove alias"
|
||||||
|
) #<#
|
||||||
|
|
||||||
|
command -f completion//parseoptions -n
|
||||||
|
if [ -z "$ARGOPT" ] || [ "$ARGOPT" = "r" ]; then
|
||||||
|
complete -T $(_z_exec "select alias from jump_list")
|
||||||
|
elif [ "$ARGOPT" = "-" ]; then
|
||||||
|
command -f completion//completeoptions
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
! [ -d ~/.config/z ] && mkdir -p ~/.config/z
|
! [ -d ~/.config/z ] && mkdir -p ~/.config/z
|
||||||
! [ -f "$JUMP_LIST" ] && _z_exec 'create table jump_list (alias text primary key, directory text not null)'
|
! [ -f "$JUMP_LIST" ] && _z_exec 'create table jump_list (alias text primary key, directory text not null)'
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue