Add bookmark function

This commit is contained in:
crater2150 2019-02-11 15:45:06 +01:00
parent 6c3826e32d
commit dbee7dfed3
2 changed files with 14 additions and 0 deletions

13
functions/bookmarks Executable file
View 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

View file

@ -90,3 +90,4 @@ if exists incstring; then
bindkey "^A" inc-last-command bindkey "^A" inc-last-command
fi fi
bindkey "\eb" zle-bookmarks