FuzzyFinder
buffer/file/command/tag/etc explorer with fuzzy matching
Install / Use
/learn @vim-scripts/FuzzyFinderREADME
This is a mirror of http://www.vim.org/scripts/script.php?script_id=1984
Repository: https://bitbucket.org/ns9tks/vim-fuzzyfinder/
Issues: http://bitbucket.org/ns9tks/vim-fuzzyfinder/issues/
Download latest(development) version https://bitbucket.org/ns9tks/vim-fuzzyfinder/get/tip.zip
Sceenshot: Buffer mode: http://cdn.bitbucket.org/ns9tks/vim-fuzzyfinder/downloads/fuzzyfinder-buffer.png File mode (searching from all files in vim runtime directories using abbreviation/multiple-search) http://cdn.bitbucket.org/ns9tks/vim-fuzzyfinder/downloads/fuzzyfinder-file-abbrev.png
============================================================================== INTRODUCTION fuf-introduction
FuzzyFinder provides convenient ways to quickly reach the buffer/file/command/bookmark/tag you want. FuzzyFinder searches with the fuzzy/partial pattern to which it converted an entered pattern.
Entered pattern Fuzzy pattern Partial pattern ~
abc *a*b*c* *abc*
dir/file dir/*f*i*l*e* dir/*file*
d*r/file d*r/*f*i*l*e* d*r/*file*
../**/s ../**/*s* ../**/*s*
(** allows searching a directory tree.)
< You will be happy when:
"./AhLongLongLongLongLongFile.txt"
"./AhLongLongLongLongLongName.txt"
"./OhLongLongLongLongLongFile.txt"
"./OhLongLongLongLongLongName.txt" <- you want :O
Type "ON" and "OhLongLongLongLongLongName.txt" will be selected. :D
FuzzyFinder can search:
- buffers
- files
- directories
- most recently used files
- files around most recently used files
- most recently used command-lines
- bookmarked files
- bookmarked directories
- tags
- files which are included in current tagfiles
- jump list
- change list
- buffer lines
- quickfix
- help
FuzzyFinder also provides APIs to use its system of searching files or selecting items.
FuzzyFinder supports multibyte characters.
============================================================================== INSTALLATION fuf-installation
Put all files into your runtime directory. If you have the zip file, extract it to your runtime directory.
You should place the files as follows:
<your runtime directory>/plugin/fuf.vim
<your runtime directory>/doc/fuf.txt
...
< If you are disgusted to make your runtime directory confused with a lot of plugins, put each of the plugins into a directory individually and just add the directory path to 'runtimepath'. It's easy to uninstall plugins.
Then update your help tags files to enable help for this plugin. See |add-local-help| for details.
Requirements: ~
- L9 library (vimscript #3252)
============================================================================== USAGE fuf-usage
You can launch FuzzyFinder by the following commands:
Command Mode ~
|:FufBuffer| - Buffer mode (|fuf-buffer-mode|)
|:FufFile| - File mode (|fuf-file-mode|)
|:FufCoverageFile| - Coverage-File mode (|fuf-coveragefile-mode|)
|:FufDir| - Directory mode (|fuf-dir-mode|)
|:FufMruFile| - MRU-File mode (|fuf-mrufile-mode|)
|:FufMruCmd| - MRU-Command mode (|fuf-mrucmd-mode|)
|:FufBookmarkFile| - Bookmark-File mode (|fuf-bookmarkfile-mode|)
|:FufBookmarkDir| - Bookmark-Dir mode (|fuf-bookmarkdir-mode|)
|:FufTag| - Tag mode (|fuf-tag-mode|)
|:FufBufferTag| - Buffer-Tag mode (|fuf-buffertag-mode|)
|:FufTaggedFile| - Tagged-File mode (|fuf-taggedfile-mode|)
|:FufJumpList| - Jump-List mode (|fuf-jumplist-mode|)
|:FufChangeList| - Change-List mode (|fuf-changelist-mode|)
|:FufQuickfix| - Quickfix mode (|fuf-quickfix-mode|)
|:FufLine| - Line mode (|fuf-line-mode|)
|:FufHelp| - Help mode (|fuf-help-mode|)
It is recommended to map these commands.
These commands open 1-line buffer to enter search pattern and start insert mode.
FuzzyFinder searchs for matching items with an entered pattern and shows them in a completion menu. For more details on pattern matching, see |fuf-search-patterns|.
If there are a lot of matching items, FuzzyFinder limits the number of enumerating items (|g:fuf_enumeratingLimit|) to speed up a response time, and highlights the pattern with "Error" group.
The first item in the completion menu will be selected automatically.
Typing <C-w> deletes one block of an entered pattern before the cursor, like a directory name.
with <C-s> (|g:fuf_keyPrevPattern|) and <C-^> (|g:fuf_keyNextPattern|), You can recall patterns which have been entered before from history.
You can open a selected item in various ways:
<CR> (|g:fuf_keyOpen|) - opens in a previous window.
<C-j> (|g:fuf_keyOpenSplit|) - opens in a split window.
<C-k> (|g:fuf_keyOpenVsplit|) - opens in a vertical-split window.
<C-l> (|g:fuf_keyOpenTabpage|) - opens in a new tab page.
To cancel and return to previous window, just leave Insert mode.
With <C-><C-> (|g:fuf_keySwitchMatching|), You can switch search method between fuzzy matching and partial matching.
With <C-t> (|g:fuf_keyNextMode|) and <C-y> (|g:fuf_keyPrevMode|), You can switch current mode without leaving Insert mode .
You can preview selected item with <C-@> (|g:fuf_keyPreview|) in some modes. Repeating the key on the same item shows another information. The height of command-line area is changed to |g:fuf_previewHeight| when you launch a mode supporting preview. This feature is available when |g:fuf_previewHeight| is not 0.
============================================================================== MODES fuf-modes
*fuf-buffer-mode*
Buffer mode ~
This mode provides an interface to select a buffer from a list of existing buffers and open it.
Press <C-]> (|g:fuf_buffer_keyDelete|) in this mode and selected buffer will be deleted.
*fuf-file-mode*
File mode ~
This mode provides an interface to search a file tree for a file and open it.
*fuf-coveragefile-mode*
Coverage-File mode ~
This mode provides an interface to select a file from all files of a preset coverage and open it.
By default, This mode lists all files under the current working directory recursively. (|g:fuf_coveragefile_globPatterns|)
If you want to search other coverage, execute |FufCoverageFileRegister| command to register new search coverage and |FufCoverageFileChange| command to choose a search coverage and launch Coverage-File mode.
In addition, there is another way to change a search coverage with |fuf#setOneTimeVariables()| function.
Example: search only .h and .c files:
call fuf#setOneTimeVariables(['g:fuf_coveragefile_globPatterns', ['**/*.h', '**/*.c']])
\ | FufCoverageFile
< Example: search your home directory in addition to the default coverage:
call fuf#setOneTimeVariables(['g:fuf_coveragefile_globPatterns', g:fuf_coveragefile_globPatterns + ['~/**/.*', '~/**/*']])
\ | FufCoverageFile
<
*fuf-dir-mode*
Directory mode ~
This mode provides an interface to search a file tree for a directory and change the current directory.
*fuf-mrufile-mode*
MRU-File mode ~
This mode provides an interface to select a file from the most recently used files and open it.
Press <C-]> (|g:fuf_mrufile_keyExpand|) in this mode and files around the most recently used files are listed. Each time the key is pressed, the search range are expanded one level along the directory tree upwardly/downwardly.
This mode is set to disable by default (|g:fuf_modesDisable|) because processes for this mode in |BufEnter| and |BufWritePost| could cause Performance issue.
See also: |FufMruFileInCwd|
*fuf-mrucmd-mode*
MRU-Command mode ~
This mode provides an interface to select a command from the most recently used commands and execute it.
This mode is set to disable by default (|g:fuf_modesDisable|) because mapping <CR> of Command-line mode required by this mode has side effects.
*fuf-bookmarkfile-mode*
Bookmark-File mode ~
This mode provides an interface to select one of the bookmarks you have added beforehand and jump there.
You can add a cursor line to bookmarks by |:FufBookmarkFileAdd| command. Execute that command and you will be prompted to enter a bookmark name.
FuzzyFinder adjusts a line number for jump. If a line of bookmarked position does not match to a pattern when the bookmark was added, FuzzyFinder searches a matching line around bookmarked position. So you can jump to a bookmarked line even if the line is out of bookmarked position. If you want to jump to bookmarked line number without the adjustment, set |g:fuf_bookmarkfile_searchRange| option to 0.
Press <C-]> (|g:fuf_bookmarkfile_keyDelete|) in this mode and selected bookmark will be deleted.
*fuf-bookmarkdir-mode*
Bookmark-Dir mode ~
This mode provides an interface to select one of the bookmarks you have added beforehand and change the current directory.
You can add a directory to bookmarks by |:FufBookmarkDirAdd| command. Execute that command and you will be prompted to enter a directory path an
