Add bookmark function
This commit is contained in:
parent
6c3826e32d
commit
dbee7dfed3
13
functions/bookmarks
Executable file
13
functions/bookmarks
Executable file
|
@ -0,0 +1,13 @@
|
||||||
|
#!/bin/zsh
|
||||||
|
function bookmarks() {
|
||||||
|
typeset -A bookmarks
|
||||||
|
while read k v; do bookmarks[$k]="$v"; done < ~/.bookmarks
|
||||||
|
target=$(printf "%s\n" ${(k)bookmarks} | fzf)
|
||||||
|
cd ${~bookmarks[$target]}
|
||||||
|
}
|
||||||
|
|
||||||
|
function zle-bookmarks() {
|
||||||
|
bookmarks
|
||||||
|
zle reset-prompt
|
||||||
|
}
|
||||||
|
zle -N zle-bookmarks
|
|
@ -90,3 +90,4 @@ if exists incstring; then
|
||||||
bindkey "^A" inc-last-command
|
bindkey "^A" inc-last-command
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
bindkey "\eb" zle-bookmarks
|
||||||
|
|
Loading…
Reference in a new issue