SuperTab continued. : Do all your insert-mode completion with Tab!
script karma |
Rating 243/74,
Downloaded by 2834 |
created by |
Eric Van Dewoestine |
|
script type |
utility |
|
description |
This is a continuation of vimscript #182 by Gergely Kontra, who has
asked me to take over support and maintenance. So if you have any
questions or suggestions, please direct them to me. Please read the
description below as some enhancements have been made as well.
Description:
This script allows you to use the tab key to do all your insert
completion (:help ins-completion).
Ex. To complete the word bar or baz
foo bar baz
b<Tab>
Default Completion Type:
By default, this script will use <C-P> completion which searches
backwards for words located in the current and other files
(:h 'complete'). You can change this default by setting the
variable g:SuperTabDefaultCompletionType:
Ex. To default to omni completion
let g:SuperTabDefaultCompletionType = "<C-X><C-O>"
Current Completion Type:
While editing you can also change the current completion type one of
two ways (note: these do not affect the default described above):
1) Kick off the new completion type in the standard manner.
Ex. To use file name completion
/us<C-X><C-F>/sha<Tab>/vi<Tab>/v<Tab>
2) Use the command :SuperTabHelp which opens a temporary window
where you can choose the completion type you wish to switch to.
Completion Type Duration:
You may notice that in the first option above the file name
completion was remembered and subsequent <Tab>s continued to use
that completion type. By default this script will remember the last
used completion type and will continue to use it until you switch to
another type. However, this behavior can be configured via the
g:SuperTabRetainCompletionType variable. Possible values include 0,
1, and 2:
0 - The current completion type is only retained for the current completion.
Once you have chosen a completion result or exited the completion
mode, the default completion type is restored.
1 - The current completion type is saved for the duration of your vim
session or until you enter a different completion mode.
(SuperTab default).
2 - The current completion type is saved until you exit insert mode (via
ESC). Once you exit insert mode the default completion type is
restored. |
|
install details |
Place the file in your plugins directory. |
|
script versions (upload new version)
Click on the package to download.
supertab.vim |
0.43 |
2007-07-12 |
6.0 |
Eric Van Dewoestine |
With the permission of the original author, this script is now released under the BSD license. |
supertab.vim |
0.42 |
2007-06-11 |
6.0 |
Eric Van Dewoestine |
- Added g:SuperTabMidWordCompletion variable to determine if completion should be done within a word (enabled by default). (based on request by Charles Gruenwald)
- Applied patch to fix <s-tab> cycling through completion results. (submitted by Lukasz Krotowski)
|
supertab.vim |
0.41 |
2006-08-30 |
6.0 |
Eric Van Dewoestine |
Initial upload |
|