From 8f6be4a9861d29cd189b07f332a56cb83bd86abd Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Mon, 14 Mar 2022 17:31:20 +0100 Subject: In progress --- .config/zsh/.zshrc | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to '.config/zsh') 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 -- cgit v1.2.3