From aba8804dae3115d604a48fef83fbdec71bbdb5f1 Mon Sep 17 00:00:00 2001 From: gotbletu Date: Mon, 10 Mar 2014 14:00:32 -0700 Subject: [PATCH] fuzzy finder --- fzf.txt | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 fzf.txt diff --git a/fzf.txt b/fzf.txt new file mode 100644 index 0000000..5120142 --- /dev/null +++ b/fzf.txt @@ -0,0 +1,23 @@ +Notes for Video: http://www.youtube.com/watch?v=hO8vd1y0h6g + + + +# ZSH keybinding example; ~/.zshrc + +fzf_history() { zle -I; eval $(history | fzf +s | sed 's/ *[0-9]* *//') ; }; zle -N fzf_history; bindkey '^F' fzf_history + +fzf_killps() { zle -I; ps -ef | sed 1d | fzf -m | awk '{print $2}' | xargs kill -${1:-9} ; }; zle -N fzf_killps; bindkey '^Q' fzf_killps + +fzf_cd() { zle -I; DIR=$(find ${1:-*} -path '*/\.*' -prune -o -type d -print 2> /dev/null | fzf) && cd "$DIR" ; }; zle -N fzf_cd; bindkey '^E' fzf_cd + + + +# BASH keybinding example; ~/.bashrc + +fh() { +eval $(history | fzf +s | sed 's/ *[0-9]* *//') +} + +bind '"\C-F":"fh\n"' # fzf history + +