sponsor Vim development Vim logo Vim Book Ad

SuperTab : Do all your insert-mode completion with Tab.

 script karma  Rating 2942/924, Downloaded by 93469  Comments, bugs, improvements  Vim wiki

created by
Eric Van Dewoestine
script type

Supertab allows you to use <Tab> for all your insert completion needs
(:help ins-completion).


- Configurable to suit you needs:
  - Default completion type to use.
  - Prevent <Tab> from completing after/before defined patterns.
  - Close vim's completion preview window when code completion is finished.
  - When using other completion types, you can configure how long to 'remember'
    the current completion type before returning to the default.
  - Don't like using <Tab>? You can also configure a different pair of keys to
    scroll forwards and backwards through completion results.
- Optional improved 'longest' completion support (after typing some characters,
  hitting <Tab> will highlight the next longest match).
- Built in 'context' completion option which chooses the appropriate completion
  type based on the text preceding the cursor.
  - You can also plug in your own functions to determine which completion type
    to use.
- Support for simple completion chaining (falling back to a different
  completion type, keyword completion for example, if omni or user completion
  returns no results).

You can also find supertab on github repository:
install details
1. Download supertab.vmb to any directory.
2. Open the file in vim ($ vim supertab.vmb).
3. Source the file (:so %).

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
supertab.vmb 2.1 2014-04-09 7.0 Eric Van Dewoestine Full list of changes: https://github.com/ervandew/supertab/compare/2.0...2.1
supertab.vmb 2.0 2012-06-01 7.0 Eric Van Dewoestine - added support for chaining two completion types (falls back to the second if not results from the first).
- added setting to close completion preview window when the completion popup closes.
- improved compatibility with other plugins.
- other minor bug fixes.
supertab.vba 1.6 2011-07-20 7.0 Eric Van Dewoestine - couple longest enhancement fixes
- added ability to disable supertab via a buffer local variable
- few other miscellaneous fixes.
supertab.vba 1.5 2011-02-16 7.0 Eric Van Dewoestine - updated to support user mapped <c-n>/<c-p>
- fix logic to decide whether to scroll up or down based on current completion context
- fix <c-x><c-*> w/ longest enhancement enabled
supertab.vba 1.4 2011-01-27 7.0 Eric Van Dewoestine Fix error that occurs attempting to complete after optional alternate completion mapping or :SuperTabHelp have set the completion type.
supertab.vba 1.3 2011-01-18 7.0 Eric Van Dewoestine - fix error attempting tab completion if buffer was loaded with no autocmds fired
- fix tabbing through completion results with longest enabled when the longest text expanded is the empty string.
supertab.vba 1.2 2011-01-09 7.0 Eric Van Dewoestine - fix to not break abbreviation expansion on <cr>
- when using longest enhancement, save/restore any previous mappings for <bs>/<c-h>
- fix <cr> mapping to cooperate better with <cr> mappings of other plugins (ex. endwise)
- created variables to set user defined list of before or after patterns for which completion should not be attempted (:h supertab-preventcomplete)
supertab.vba 1.1 2010-09-27 7.0 Eric Van Dewoestine - added optional default <cr> mapping to end completion mode (enabled by default)
- added support for an enhanced longest match completion (disabled by default)
- other minor enhancements + bug fixes
supertab.vba 1.0 2009-12-03 7.0 Eric Van Dewoestine - fixed reverse cycling through result when using <c-n> completion
- now distributed as a vimball with a help file (:h supertab).  Thanks to Christophe-Marie Duquesne.
supertab.vim 0.61 2009-10-16 7.0 Eric Van Dewoestine Fixed a possible error that may occur in some rare conditions.
supertab.vim 0.60 2009-09-16 7.0 Eric Van Dewoestine - Refactored the contextual completion and default discovery support.
  - Context completion now supports plugable functions to determine which
    completion type to use.
  - Default discovery is now a part of context completion.
- NOTE: Several non-backwards compatible configuration changes where made.
  - g:SuperTabRetainCompletionType is now g:SuperTabRetainCompletionDuration
    and accepts one of 'none', 'insert', or 'session'.
  - new setting g:SuperTabCompletionContexts defines which context completion
    functions are consulted.
  - g:SuperTabDefaultCompletionTypeDiscovery is now
    g:SuperTabContextDiscoverDiscovery and requires that
    g:SuperTabContextDefaultCompletionType is set to 'context' and that
    's:ContextDiscover' is in your g:SuperTabCompletionContexts list.
Please see the updated "Global Variables" fold in supertab.vim for additional
details and examples.
supertab.vim 0.51 2009-07-11 7.0 Eric Van Dewoestine Replaced internal function s:IsWordChar with vim's keyword character class (Thanks to Ingo Karkat for the patch).
supertab.vim 0.50 2009-06-26 7.0 Eric Van Dewoestine Added check for vim 7 or greater, otherwise disable supertab support (suggested by Vincent Lee).  Also, removed any remaining pre vim 7 logic that is no longer applicable.
supertab.vim 0.49 2009-02-05 7.0 Eric Van Dewoestine fixed case where new buffer may not be initialized by super tab (thanks to Tammer Saleh for reporting the issue).
supertab.vim 0.48 2009-01-18 7.0 Eric Van Dewoestine Fixed command line completion (ctrl-x ctrl-v) when invoked from supertab.  Thanks to Frank Chang for the patch.
supertab.vim 0.47 2009-01-11 7.0 Eric Van Dewoestine fixed issue with default completion discovery option if desired type is dependent on file type plugins.  Thanks to Andreas Schneider for reporting the issue.
supertab.vim 0.46 2008-11-15 7.0 Eric Van Dewoestine Added support for default completion type 'context', which will result in super tab attempting to determine which completion type to use (file, user/omni, keyword) based on the text preceding the cursor (Based on suggestion by François Beaubert).
supertab.vim 0.45 2007-12-18 6.0 Eric Van Dewoestine - fixed possible completion error on first buffer as supertab may not have been properly initialized (thanks to bill emmons for discovering the error).
supertab.vim 0.44 2007-11-08 6.0 Eric Van Dewoestine - added config variable to specify discovery list used to determine the default completion type to use for the current buffer. (based on request by Den Yao)
- added config variables to changed the default mappings for forward backwards completion. (based on request by Li Chaoqun)
- added config variable to preselect the first entry when completeopt has 'menu' and 'longest'. (based on suggestion and patch by Mike Lundy)
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
ip used for rating:

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.