mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-01-30 09:48:11 +01:00
Compare commits
2 Commits
ac1f7bf0cc
...
b200dbd8a6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b200dbd8a6 | ||
|
|
de1f15f92c |
@ -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