mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-01-30 09:48:11 +01:00
Merge de1f15f92cc641b9f99d49875d52d4658b6c94b0 into c95a16916d5c71288e5e49a78d0621943c89a682
This commit is contained in:
commit
187bee2d3a
@ -54,13 +54,7 @@ preexec() { echo -ne '\e[5 q' ;} # Use beam shape cursor for each new prompt.
|
|||||||
|
|
||||||
# Use lf to switch directories and bind it to ctrl-o
|
# Use lf to switch directories and bind it to ctrl-o
|
||||||
lfcd () {
|
lfcd () {
|
||||||
tmp="$(mktemp -uq)"
|
cd "$(command lf -print-last-dir "$@")"
|
||||||
trap 'rm -f $tmp >/dev/null 2>&1 && trap - HUP INT QUIT TERM PWR EXIT' HUP INT QUIT TERM PWR EXIT
|
|
||||||
lf -last-dir-path="$tmp" "$@"
|
|
||||||
if [ -f "$tmp" ]; then
|
|
||||||
dir="$(cat "$tmp")"
|
|
||||||
[ -d "$dir" ] && [ "$dir" != "$(pwd)" ] && cd "$dir"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
bindkey -s '^o' '^ulfcd\n'
|
bindkey -s '^o' '^ulfcd\n'
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user