supertab for vim

使用tab来满足你全部补齐的需要.
(如complete选项[是需要扫描地区的列表]指定的,使用<c-p>,<c-n>调用的补全;onmi全能补全,使用<c-x><c-o>)

设置tab使用的completion类型.
a "context" complete, 更智能.区分(omni,file,user,or keyword,your own functions)

copmpletion类型为file时候,
"
SuperTab后来加入一个新功能,对于程序源文件,可以在其引入的文件以及API文件中匹配关键词。比如假设我当前正在编辑a.php,在a.php中有 include ‘b.php’;这样的语句,当我输入 array并按下Tab键时,SuperTab不但会在当前文件中查询所有匹配项,还会到b.php中查询,如果配置过vim、指定一个包含了php的API的文件,则SuperTab还会自动从这个文件中查询匹配项。
"


let g:SuperTabDefaultCompletionType="<C-X><C-O>"
" 设置按下<Tab>后默认的补全方式, 默认是<C-P>,
" 现在改为<C-X><C-O>. 关于<C-P>的补全方式,

" 还有其他的补全方式, 你可以看看下面的一些帮助:
" :help ins-completion
" :help compl-omni

let g: SuperTabRetainCompletionType=2
" 0 - 不记录上次的补全方式
" 1 - 记住上次的补全方式,直到用其他的补全命令改变它
" 2 - 记住上次的补全方式,直到按ESC退出插入模式为止
" 想用tab的话貌似按 Ctrl-Tab就可以了。。"

Supertab provides several features to enhance your insert completion experience:
- You can set your favorite insert completion type (keyword, omni, etc.) as   supertab's default.
- When using another completion type (ctrl-x ctrl-f), supertab will   temporarily make that the default allowing you to continue to use tab for   that completion. The duration is configurable to one of 'completion'   (retained until you exit the current completion mode), 'insert' (retained   until you leave insert mode), or 'session' (retained for the remainder of   your vim session).
- Supertab provides a 'context' completion type which examines the text   preceding the cursor to decide which type of completion should be used   (omni, user, file, or keyword).  You can also plug in your own functions   which will be used to determine which completion type to use according to   your new functionality.
- The 'context' completion can also be used to set the default completion type   according to what the file supports, based on a discovery mechanism which   you specify.
- For users not yet familiar with all the various insert completion types that   vim supports, supertab also provides a : SuperTabHelp command which opens a   temporary buffer listing all the available types and the ability to easily
转自:http://blog.163.com/ghlndsl@126/blog/static/122125934201111635419141/
下载地址:http://www.vim.org/scripts/script.php?script_id=1643

你可能感兴趣的:(vim)