From c8f970cc1adfb31b421381a36091622646ccc0b7 Mon Sep 17 00:00:00 2001 From: Danielle McLean Date: Thu, 20 Oct 2016 09:22:00 +1100 Subject: [PATCH] Add a simple widget on Ctrl-G for fzfing my frecently used directories from z --- config/zsh/interactive/bindings | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/config/zsh/interactive/bindings b/config/zsh/interactive/bindings index e0e173c..c6c7af4 100644 --- a/config/zsh/interactive/bindings +++ b/config/zsh/interactive/bindings @@ -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