From 5941f6f77adffcd410a4876b68b8dcf648f1d9db Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Mon, 4 Dec 2023 08:39:19 +0100 Subject: [PATCH] vifm: Extend fzf mapping functionality Extended functionality to work in current directory with lower-case letters and from home directory using upper-case. So, f will search files in current dir, F in home dir. Same for d/D and w/W. HACK Also made it use fd instead of find by default for the speedup. This should probably only be done after detecting if fd is even installed on the system but I do not have time for this right now. --- terminal/.config/vifm/vifmrc | 15 +++++++++++---- terminal/.config/wezterm/maps.lua | 1 + 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/terminal/.config/vifm/vifmrc b/terminal/.config/vifm/vifmrc index 7d7cffe..54bb2c1 100644 --- a/terminal/.config/vifm/vifmrc +++ b/terminal/.config/vifm/vifmrc @@ -168,17 +168,22 @@ command! mkcd :mkdir %a | cd %a command! syncme :cd %D command! fzfhome : set noquickview - \| let $FZF_PICK = term('locate $HOME | fzf 2>/dev/tty') + \| let $FZF_PICK = term('fd . $HOME | fzf 2>/dev/tty') \| if $FZF_PICK != '' \| execute 'goto' fnameescape($FZF_PICK) \| endif command! fzf : set noquickview - \| let $FZF_PICK = term('find | fzf 2>/dev/tty') + \| let $FZF_PICK = term('fd | fzf 2>/dev/tty') \| if $FZF_PICK != '' \| execute 'goto' fnameescape($FZF_PICK) \| endif +command! fzfcdhome : set noquickview + \| let $FZF_PICK = term('fd -td . $HOME | fzf 2>/dev/tty') + \| if $FZF_PICK != '' + \| execute 'cd' fnameescape($FZF_PICK) + \| endif command! fzfcd : set noquickview - \| let $FZF_PICK = term('find -type d | fzf 2>/dev/tty') + \| let $FZF_PICK = term('fd -td | fzf 2>/dev/tty') \| if $FZF_PICK != '' \| execute 'cd' fnameescape($FZF_PICK) \| endif @@ -300,8 +305,10 @@ noremap ,pc :!pdftk %f cat output output.pdf " fzf movements nnoremap f :fzf +nnoremap F :fzfhome nnoremap c :fzfcd -nnoremap F :grep +nnoremap C :fzfcdhome +nnoremap w :grep " preview thumbnails of current folder " select thumbnails with m/M in nsxiv diff --git a/terminal/.config/wezterm/maps.lua b/terminal/.config/wezterm/maps.lua index 4f749ed..74cc6bd 100644 --- a/terminal/.config/wezterm/maps.lua +++ b/terminal/.config/wezterm/maps.lua @@ -65,6 +65,7 @@ local keys = { }), }, { key = "f", mods = "LEADER", action = act.QuickSelect }, + -- open web link { key = "F", mods = "LEADER",