mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2025-10-07 07:22:36 +02:00
Fix the J keybinding in lf
Now it's easy to jump to your bookmarked directories in lf, just press J and enter the shortcut.
This commit is contained in:
parent
c43f390f07
commit
7db5655bf8
@ -148,9 +148,22 @@ cmd bulkrename ${{
|
||||
lf -remote "send $id unselect"
|
||||
}}
|
||||
|
||||
cmd shortcutjump ${{
|
||||
set -f
|
||||
clear; tput cup $(($(tput lines)/3))
|
||||
tmp="$(mktemp)" && trap 'rm "$tmp"' EXIT || exit
|
||||
sed 's/\s*#.*//; /^$/d' "${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs" > "$tmp"
|
||||
choice=$(cat "$tmp" | fzf --layout=reverse --height 40% --listen --no-ignore-case --tiebreak=begin,chunk -n1 \
|
||||
--bind result:transform:"grep -q '^{q}\s' \"$tmp\" && [ \$(grep '^{q}\S*\s' \"$tmp\" | wc -l) -eq 1 ] && echo accept" | \
|
||||
sed 's/\S\+\s\+//')
|
||||
[ -z "$choice" ] && exit
|
||||
path=$(eval printf '%s' \"$choice\")
|
||||
lf -remote "send $id cd $path"
|
||||
}}
|
||||
|
||||
# Bindings
|
||||
map <c-f> $lf -remote "send $id select \"$(fzf)\""
|
||||
map J $lf -remote "send $id cd $(sed -e 's/\s*#.*//' -e '/^$/d' -e 's/^\S*\s*//' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf)"
|
||||
map J shortcutjump
|
||||
map H cd ~
|
||||
map g top
|
||||
map D delete
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user