blob: 02b85e7c4feb0ac0473fb471bde1314af175294d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
fzf-change-dir-cwd() { # fzf + cd in cwd
selected=$(find . -maxdepth 1 -type d | fzf);
if [ ! -z "$selected" ] && [ "$selected" != "$(pwd)" ]; then
cd $selected;
fi
zle send-break || true
}
zle -N fzf-change-dir-cwd;
bindkey '^O' fzf-change-dir-cwd;
fzf-change-dir() {
local result=$(find -type d | fzf);
if ! [[ -z "$result" ]]; then
cd "$result"
fi
zle send-break || true
}
zle -N fzf-change-dir;
bindkey '^F' fzf-change-dir;
|