- use Vim's
matchfuzzy()
function; do not depend on an external executable (like fzf / skim / zf...); - do not block the UI even with large input;
- support readline-style keybindings;
- partially; the mouse cursor is always at the end;
- On Windows,
bash.exe
orbusybox.exe
is required for functions invoking shellcmd (PickGotoProject
);- You can get
bash.exe
from "Git for Windows" project, and ensure it is in%PATH%
; - Alternatively, you can get
busybox.exe
from busybox-w32 project, and put it in%PATH%
; - Preferring
bash.exe
overbusybox.exe
, sincebash.exe
(Git for Windows) is more CJK friendly.
- You can get
If you have configured that only the
git
executable is available from command prompt (cmd.exe), then you can add the following snippet to your vimrc:
if has('win32') && executable('git') && !executable('bash')
" in vim9script, remove the "let" and this line of comment.
let $PATH = $PATH .. ';' .. exepath('git')->substitute('\v[\/]cmd[\/]git.exe$', '/bin', '')
endif
-
On Unix-like systems,
find
andsed
are required forPickGotoProject
; -
When
bfs
orfind
is available, and variableg:fuzzy#cwdfiles#vim_func
is set to0
, then the executable is used forPickCwdFiles
; otherwise Vim's readdir() is used (it is slower to count files thanfind
, but the fuzzy functionality may be faster. So it is the default.) -
rg
orgrep
is required forPickGrep
;
nnoremap <Space>ff <ScriptCmd>PickCwdFiles()<CR>
nnoremap <Space>fg <ScriptCmd>PickGrep()<CR>
nnoremap <Space>fr <ScriptCmd>PickRecentFiles()<CR>
nnoremap <Space>fp <ScriptCmd>PickGotoProject()<CR>
nnoremap <Space>fc <ScriptCmd>PickUserCommand()<CR>
nnoremap <Space>fm <ScriptCmd>PickUserMapping()<CR>
nnoremap <Space>fh <ScriptCmd>PickHelpTags()<CR>
nnoremap <Space>fa :Pick<Space>
nnoremap <Space>fl <ScriptCmd>PickLines()<CR>
nnoremap <Space>fq <ScriptCmd>PickQuickFix()<CR>
nnoremap <Space>fb <ScriptCmd>PickBuffer()<CR>
nnoremap <Space>ft <ScriptCmd>PickGotoTabWin()<CR>
:Pick
is a UserCommand defined by this plugin; it accepts shellcmd as
arguments; when confirmed, Vim will edit the selected item.
<C-h>
/<C-w>
/<C-u>
to kill a char / word / whole line;<C-j>
/<C-n>
to select next item;<C-k>
/<C-p>
to select previous item;<C-c>
/<C-[>
/<Esc>
/ (when the search string is empty:<C-d>
) to quit fuzzy finder;
This plugin exposes autoload functions:
fuzzy#Pick()
: endpoint to launch the fuzzy finder;fuzzy#AppendItems()
: if you want to provide the input asynchronously without job related functions.
you need to see how other mappings use them.
You can go to other mappings' defenitions quickly by pressing <Space>fm
and filter by "pick", if you have enabled this plugin.