使用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退出插入模式爲止
"
"
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