This plugin is mainly used for locating files, buffers, mrus in large project.
- Written in Python.
- Support for fuzzy and regex searching.
- Manage buffers and mrus.
- Open multiple files at once.
- Extensible.
- vim7.0 or higher.
- vim compiled with Python support, you can check by using
echo has('python')
orecho has('python3')
to see if the result is1
.
To install this plugin just put the plugin files in your ~/.vim
(Linux) or ~/vimfiles
(Windows).
For Vundle user, just add Bundle 'Yggdroot/LeaderF'
to your .vimrc
.
-
:Leaderf
or:Leaderf [directory]
or,f
Launch LeaderF to search files. -
:LeaderfBuffer
or,b
Launch LeaderF to search buffers. -
:LeaderfMru
Launch LeaderF to search Mru.
Once LeaderF is launched:
<C-C>
: quit from LeaderF.<C-R>
: switch between fuzzy search mode and regex mode.<C-F>
: switch between full path search mode and name only search mode.<ESC>
: switch to normal mode.<C-V>
: paste from clipboard.<C-U>
: clear the prompt.<C-J>
,<Down>
,<C-K>
,<Up>
: navigate the result list.<2-LeftMouse>
or<CR>
: open the file under cursor or selected(when multiple files are selected).<C-X>
: open in horizontal split window.<C-]>
: open in vertical split window.<C-T>
: open in new tabpage.<F5>
: refresh the cache.<C-LeftMouse>
or<C-Z>
: select multiple files.
Input formats:
- In NameOnly mode (fuzzy)
'abc'
is interpreted as vim's regexp 'a.\{-}b.\{-}c'
.
If the first character you input is '/'
, then the searching will be the same as in FullPath mode.
If you input string as 'abc/def/gh'
, then 'abc'
will match the file name and 'def/gh'
will match the directory name as in FullPath mode.
- In FullPath mode (fuzzy)
'ab'
is interpreted as vim's regexp 'a[^/]\{-}b'
.
'/'
is interpreted as vim's regexp '[/].\{-}'
.
'ab/c'
is interpreted as vim's regexp 'a[^/]\{-}b[^/]\{-}[/].\{-}[^/]\{-}c'
.
If you want to search '/example/full/path/mode/filename.txt'
, you must input like this: 'ex/fu/pa/mo/file'
(NOTE that '/'
is essential in the input), and 'exfupamofile'
won't match.
The purpose for this restriction is to decrease the number of matches.
- In Regexp mode
The input string is the same as the Vim's regexp.
- ctrlp is a great plugin. Some ideas of my plugin come from it.
The only advantage over ctrlp is performance. If you are smart enough, perhaps you can find more.
This plugin is released under the Vim License.