shownotes-w3m-rice/fzf.txt

24 lines
646 B
Plaintext
Raw Normal View History

2014-03-10 21:00:32 +00:00
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