Add a simple widget on Ctrl-G for fzfing my frecently used directories from z

This commit is contained in:
Danielle McLean 2016-10-20 09:22:00 +11:00
parent 53e8606b27
commit c8f970cc1a
No known key found for this signature in database
GPG key ID: CC91589719027E94

View file

@ -32,3 +32,13 @@ zle -N bracketed-paste bracketed-paste-magic
autoload -Uz url-quote-magic
url-quote-magic-with-highlight() { url-quote-magic; _zsh_highlight }
zle -N self-insert url-quote-magic-with-highlight
__fzf-z() {
z -l | tac | cut -c 12- | fzf --preview 'tree -FCL 2 {}'
}
fzf-z() {
LBUFFER+="$(__fzf-z)"
zle redisplay
}
zle -N fzf-z
bindkey '^G' fzf-z