forked from gotbletu/shownotes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfzf.txt
More file actions
23 lines (10 loc) · 646 Bytes
/
fzf.txt
File metadata and controls
23 lines (10 loc) · 646 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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