Ⅰ. 插件描述
Fuzzy pattern building, in any bufferⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'ggvgc/vim-fuzzysearch'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'ggvgc/vim-fuzzysearch'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'ggvgc/vim-fuzzysearch'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/ggvgc/vim-fuzzysearch
Ⅳ. 文档说明
vim-fuzzysearch
Adds fuzzy capabilities to normal search in vim.
image:doc/example.gif[]
=== :FuzzySearch
Acts just like normal buffer searching, except with fuzzy matching between each letter. +
Space matches a series of any characters(translates to .\{-})
== Matching
By default, fuzzysearch doesn't match over spaces. That means that "fr" will NOT match "foo bar", but "f r" will.
If you dislike this behaviour, set g:fuzzysearch_match_spaces = 1.
The reasoning behind the default behaviour is that it is much easier to narrow down searches, in order to re-use patterns later, for example in a replacement by :%s//<new_string>/g.
=== Useful mappings
Replace in file using last search: nnoremap <leader>r :%s///g<left><left> +
I find it very useful to create a fuzzy search quickly, then replace all instances using this mapping.
=== Optionsg:fuzzysearch_prompt = 'fuzzy /' +g:fuzzysearch_hlsearch = 1 +g:fuzzysearch_ignorecase = 1 +g:fuzzysearch_max_history = 30 +g:fuzzysearch_match_spaces = 0