diff options
Diffstat (limited to '.config/zsh')
-rw-r--r-- | .config/zsh/.zshrc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index a437d68..977be7b 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -81,6 +81,18 @@ globalias() { zle -N globalias +# Use lf to switch directories and bind it to ctrl-o +lfcd () { + tmp="$(mktemp)" + lf -last-dir-path="$tmp" "$@" + if [ -f "$tmp" ]; then + dir="$(cat "$tmp")" + rm -f "$tmp" >/dev/null + [ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir" + fi +} +bindkey -s '^o' '^ulfcd\n' + bindkey -v "^ " globalias bindkey -v " " magic-space bindkey -M isearch " " magic-space |