sponsor Vim development Vim logo Vim Book Ad

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

 script karma  Rating 1623/499, Downloaded by 39586    Comments, bugs, improvements  Vim wiki

created by
Eric Van Dewoestine
 
script type
utility
 
description
Supertab aims to provide tab completion to satisfy all your insert completion
needs (:help ins-completion).

This version is a continuation of vimscript #182 by Gergely Kontra, who has
asked me to take over support and maintenance.  This version contains many
enhancements.

You can also find supertab in my github repository:
http://github.com/ervandew/supertab

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
  switch to that type.

After installing, see the supertab help for more information (:h supertab).
 
install details
1. Download supertab.vba to any directory.
2. Open the file in vim ($ vim supertab.vba).
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.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

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.
   
SourceForge.net Logo