Ⅰ. 插件描述
an extension to the lookupfile plugin - supporting user friendly regex searching of your project files.Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'dsummersl/lookupfile-grep'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'dsummersl/lookupfile-grep'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'dsummersl/lookupfile-grep'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/dsummersl/lookupfile-grep
Ⅳ. 文档说明
" Documentation:
"
" This is a plugin for the lookupfile plugin. It has two usable functions that
" integrate into the lookupfile plugin. Both functions have these basic
" features:
"
" - The &path and the &suffixesadd are taken into account to determine
" whether a file should be visible in the drop down list.
" - To make for quicker file lookups when '*' is part of the search pattern
" it is treated as if it were '.' (the probably intent of by the user).
" - You can setup whether searches are case sensitive through the
" g:LookupFileGrep_IgnoreCase setting.
" - To support changing the path/suffixesadd values on the fly you can use
" the GrepLookup/CaseLookupFile functions directly (b/c &path and
" &suffixesadd are settings local to the buffer they are not garaunteed to
" work with any lookupfile functions if you set &path/&suffixesadd directly.
"
" Requirements:
"
" Vim-7.0
"
" lookupfile plugin (v 1.4+) -- TODO please use the one in this repo for now.
" the one on the vim website is significantly newer and may not work.
"
" findutils (find command requires -wholename for 'folder/*/subfolder' type patterns in find command)
" textutils (sed, xargs, etc)
"
" Installation:
"
" Copy the vim files in the plugin folder to your ~/.vim/plugin folder.
" Copy the vim files in the autoload folder to your ~/.vim/autoload folder.
"
" To see examples of how you can use/setup these commands for your own
" projects I have included example source scripts that I use to setup my own
" projects in the 'project' folder. I put this folder in ~/.vim/.
"
" I put these in my .vimrc:
"
" function! LoadProject(type,directory)
" " type = the type of project.
" " directory = Directory of the project to set up for.
" "
" " Load a project. This is a generic function that loads a script for a type
" " of project. Each type of project keeps its functions in a directory
" " named after the project (~/.vim/Project/{type}). When this function is
" " called, the script ~/.vim/Project/{type}/in.vim is executed, with
" " b:proj_cd set to the directory of the project that in.vim should setup
" " for.
" "
" let b:proj_cd=getcwd()
" if (a:directory != '')
" let b:proj_cd=a:directory
" endif
" exec "source ~/.vim/project/". a:type .".vim"
" endfunction
"
" command! -nargs=? -bang -complete=dir MR :call LoadProject("maven",<q-args>)
" command! -nargs=? -bang -complete=dir RR :call LoadProject("rails",<q-args>)
" command! -nargs=? -bang -complete=dir JR :call LoadProject("java",<q-args>)
" command! -nargs=? -bang -complete=dir SR :call LoadProject("script",<q-args>)
"
" Then I use these mappings to quickly setup my current directly (ie, use the
" :cd <directory of project>) as a specific type of project...java,rails,etc:
" by typing say, :JR -- which would setup my <localleader>t to look for java
" class files, <localleader>r to look for java type files (resources, xml,
" java), and <localleader>g to grep java type files for some pattern.
"
" GrepLookup:
" The GrepLookup provides a similar feature set to the builtin :grep and
" :vimgrep provided in Vim, except that it is integrated into the lookupfile
" plugin. In short: type in a pattern, and any file that contains the
" pattern is displayed in a drop down.
"
" CaseLookupFile:
" This function is similar to the default LUPath function provided by the
" lookupfile plugin, except that it has the standard behavior listed
" previously (takes &path & &suffixesadd plus '' converted to '.', etc).
"
" BunnyCaseLookupFile:
" Matches files as above, but in addition automatically turns a capital
" letter search into 'u*' so that you can quickly match agains the capital
" letters (handy for long java file names).
"
" TODO add the ability to specify whether cache files are temporary or permanent (and if they are
" permanent, then add a function to flush them out.
"
" Thanks:
" Hari Krishna Dara, the lookupfile plugin author
" Adam Thorsen, suffering beta tester