- use Vim's
matchfuzzy()function; do not depend on an external executable (like fzf / skim / zf...); - use
'to insert a literal search;- example:
hello 'alice world 'bobwill do fuzzy match with stringhello worldand filter by exact match (aliceandbob);
- example:
- do not block the UI even with large input;
- support readline-style keybindings;
- On Windows,
bash.exeorbusybox.exeis required for functions invoking shellcmd (PickGotoProject);- You can get
bash.exefrom "Git for Windows" project, and ensure it is in%PATH%; - Alternatively, you can get
busybox.exefrom busybox-w32 project, and put it in%PATH%; - Preferring
bash.exeoverbusybox.exe, sincebash.exe(Git for Windows) is more CJK friendly.
- You can get
If you have configured that only the
gitexecutable 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,
findandsedare required forPickGotoProject; -
When
bfsorfindis available, and variableg:fuzzy#cwdfiles#vim_funcis 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.) -
rgorgrepis 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>/<C-k>to kill a char / word / to-start / to-end;<C-n>to select next item;<C-p>to select previous item;<C-a>/<C-e>/<C-f>/<C-b>to move cursor (home / end / right / left);<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.
