r1285 - in /trunk/packages/vim-scripts: debian/changelog debian/vim-scripts.status html/index.html html/plugin_supertab.vim.html plugin/supertab.vim

jamessan at users.alioth.debian.org jamessan at users.alioth.debian.org
Fri Dec 5 16:11:25 UTC 2008


Author: jamessan
Date: Fri Dec  5 16:11:24 2008
New Revision: 1285

URL: http://svn.debian.org/wsvn/pkg-vim/?sc=1&rev=1285
Log:
* Updated addons:
  - supertab

Modified:
    trunk/packages/vim-scripts/debian/changelog
    trunk/packages/vim-scripts/debian/vim-scripts.status
    trunk/packages/vim-scripts/html/index.html
    trunk/packages/vim-scripts/html/plugin_supertab.vim.html
    trunk/packages/vim-scripts/plugin/supertab.vim

Modified: trunk/packages/vim-scripts/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim-scripts/debian/changelog?rev=1285&op=diff
==============================================================================
--- trunk/packages/vim-scripts/debian/changelog (original)
+++ trunk/packages/vim-scripts/debian/changelog Fri Dec  5 16:11:24 2008
@@ -1,3 +1,10 @@
+vim-scripts (20081205-1) UNRELEASED; urgency=low
+
+  * Updated addons:
+    - supertab
+
+ -- James Vega <jamessan at debian.org>  Fri, 05 Dec 2008 11:08:16 -0500
+
 vim-scripts (20080722-1) unstable; urgency=low
 
   * New addons:

Modified: trunk/packages/vim-scripts/debian/vim-scripts.status
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim-scripts/debian/vim-scripts.status?rev=1285&op=diff
==============================================================================
--- trunk/packages/vim-scripts/debian/vim-scripts.status (original)
+++ trunk/packages/vim-scripts/debian/vim-scripts.status Fri Dec  5 16:11:24 2008
@@ -331,7 +331,7 @@
 email:       ervandew at yahoo.com
 license:     BSD, see /usr/share/common-licenses/BSD
 disabledby:  let loaded_supertab = 1
-version:     0.45
+version:     0.46
 
 script_name: plugin/lbdbq.vim
 addon:       lbdbq

Modified: trunk/packages/vim-scripts/html/index.html
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim-scripts/html/index.html?rev=1285&op=diff
==============================================================================
--- trunk/packages/vim-scripts/html/index.html (original)
+++ trunk/packages/vim-scripts/html/index.html Fri Dec  5 16:11:24 2008
@@ -51,7 +51,7 @@
    <li><a href="syntax_mkd.vim.html">syntax/mkd.vim.html</a></li>
   </ul>
   <p>
-  Page generated on Tue, 22 Jul 2008 19:18:21 -0400
+  Page generated on Fri, 05 Dec 2008 11:08:07 -0500
 .
   </p>
  </body>

Modified: trunk/packages/vim-scripts/html/plugin_supertab.vim.html
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim-scripts/html/plugin_supertab.vim.html?rev=1285&op=diff
==============================================================================
--- trunk/packages/vim-scripts/html/plugin_supertab.vim.html (original)
+++ trunk/packages/vim-scripts/html/plugin_supertab.vim.html Fri Dec  5 16:11:24 2008
@@ -153,8 +153,8 @@
 <tr>
   <td class="lightbg"><b>&nbsp;script karma&nbsp;</b></td>
   <td>
-    Rating <b>387/116</b>,
-    Downloaded by 5048  </td>
+    Rating <b>571/170</b>,
+    Downloaded by 9884  </td>
 </tr>
 </table>
 <p>
@@ -204,44 +204,52 @@
     <th valign="top">release notes</th>
 </tr>
 <tr>
-        <td class="rowodd" valign="top" nowrap><a href="download_script.php?src_id=8070">supertab.vim</a></td>
-    <td class="rowodd" valign="top" nowrap><b>0.45</b></td>
-    <td class="rowodd" valign="top" nowrap><i>2007-12-18</i></td>
+        <td class="rowodd" valign="top" nowrap><a href="download_script.php?src_id=9510">supertab.vim</a></td>
+    <td class="rowodd" valign="top" nowrap><b>0.46</b></td>
+    <td class="rowodd" valign="top" nowrap><i>2008-11-15</i></td>
+    <td class="rowodd" valign="top" nowrap>7.0</td>
+    <td class="rowodd" valign="top"><i><a href="/account/profile.php?user_id=6016">Eric Van Dewoestine</a></i></td>
+    <td class="rowodd" valign="top" width="2000">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).
<br></td>
+</tr>
+<tr>
+        <td class="roweven" valign="top" nowrap><a href="download_script.php?src_id=8070">supertab.vim</a></td>
+    <td class="roweven" valign="top" nowrap><b>0.45</b></td>
+    <td class="roweven" valign="top" nowrap><i>2007-12-18</i></td>
+    <td class="roweven" valign="top" nowrap>6.0</td>
+    <td class="roweven" valign="top"><i><a href="/account/profile.php?user_id=6016">Eric Van Dewoestine</a></i></td>
+    <td class="roweven" valign="top" width="2000">- fixed possible completion error on first buffer as supertab may not have been properly initialized (thanks to bill emmons for discovering the error).</td>
+</tr>
+<tr>
+        <td class="rowodd" valign="top" nowrap><a href="download_script.php?src_id=7904">supertab.vim</a></td>
+    <td class="rowodd" valign="top" nowrap><b>0.44</b></td>
+    <td class="rowodd" valign="top" nowrap><i>2007-11-08</i></td>
     <td class="rowodd" valign="top" nowrap>6.0</td>
     <td class="rowodd" valign="top"><i><a href="/account/profile.php?user_id=6016">Eric Van Dewoestine</a></i></td>
-    <td class="rowodd" valign="top" width="2000">- fixed possible completion error on first buffer as supertab may not have been properly initialized (thanks to bill emmons for discovering the error).</td>
-</tr>
-<tr>
-        <td class="roweven" valign="top" nowrap><a href="download_script.php?src_id=7904">supertab.vim</a></td>
-    <td class="roweven" valign="top" nowrap><b>0.44</b></td>
-    <td class="roweven" valign="top" nowrap><i>2007-11-08</i></td>
+    <td class="rowodd" valign="top" width="2000">- 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)
<br>- added config variables to changed the default mappings for forward backwards completion. (based on request by Li Chaoqun)
<br>- added config variable to preselect the first entry when completeopt has 'menu' and 'longest'. (based on suggestion and patch by Mike Lundy)</td>
+</tr>
+<tr>
+        <td class="roweven" valign="top" nowrap><a href="download_script.php?src_id=7344">supertab.vim</a></td>
+    <td class="roweven" valign="top" nowrap><b>0.43</b></td>
+    <td class="roweven" valign="top" nowrap><i>2007-07-12</i></td>
     <td class="roweven" valign="top" nowrap>6.0</td>
     <td class="roweven" valign="top"><i><a href="/account/profile.php?user_id=6016">Eric Van Dewoestine</a></i></td>
-    <td class="roweven" valign="top" width="2000">- 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)
<br>- added config variables to changed the default mappings for forward backwards completion. (based on request by Li Chaoqun)
<br>- added config variable to preselect the first entry when completeopt has 'menu' and 'longest'. (based on suggestion and patch by Mike Lundy)</td>
-</tr>
-<tr>
-        <td class="rowodd" valign="top" nowrap><a href="download_script.php?src_id=7344">supertab.vim</a></td>
-    <td class="rowodd" valign="top" nowrap><b>0.43</b></td>
-    <td class="rowodd" valign="top" nowrap><i>2007-07-12</i></td>
+    <td class="roweven" valign="top" width="2000">With the permission of the original author, this script is now released under the BSD license.</td>
+</tr>
+<tr>
+        <td class="rowodd" valign="top" nowrap><a href="download_script.php?src_id=7228">supertab.vim</a></td>
+    <td class="rowodd" valign="top" nowrap><b>0.42</b></td>
+    <td class="rowodd" valign="top" nowrap><i>2007-06-11</i></td>
     <td class="rowodd" valign="top" nowrap>6.0</td>
     <td class="rowodd" valign="top"><i><a href="/account/profile.php?user_id=6016">Eric Van Dewoestine</a></i></td>
-    <td class="rowodd" valign="top" width="2000">With the permission of the original author, this script is now released under the BSD license.</td>
-</tr>
-<tr>
-        <td class="roweven" valign="top" nowrap><a href="download_script.php?src_id=7228">supertab.vim</a></td>
-    <td class="roweven" valign="top" nowrap><b>0.42</b></td>
-    <td class="roweven" valign="top" nowrap><i>2007-06-11</i></td>
+    <td class="rowodd" valign="top" width="2000">- Added g:SuperTabMidWordCompletion variable to determine if completion should be done within a word (enabled by default).&nbsp;&nbsp;(based on request by Charles Gruenwald)
<br>- Applied patch to fix &lt;s-tab&gt; cycling through completion results. (submitted by Lukasz Krotowski)
<br></td>
+</tr>
+<tr>
+        <td class="roweven" valign="top" nowrap><a href="download_script.php?src_id=6114">supertab.vim</a></td>
+    <td class="roweven" valign="top" nowrap><b>0.41</b></td>
+    <td class="roweven" valign="top" nowrap><i>2006-08-30</i></td>
     <td class="roweven" valign="top" nowrap>6.0</td>
     <td class="roweven" valign="top"><i><a href="/account/profile.php?user_id=6016">Eric Van Dewoestine</a></i></td>
-    <td class="roweven" valign="top" width="2000">- Added g:SuperTabMidWordCompletion variable to determine if completion should be done within a word (enabled by default).&nbsp;&nbsp;(based on request by Charles Gruenwald)
<br>- Applied patch to fix &lt;s-tab&gt; cycling through completion results. (submitted by Lukasz Krotowski)
<br></td>
-</tr>
-<tr>
-        <td class="rowodd" valign="top" nowrap><a href="download_script.php?src_id=6114">supertab.vim</a></td>
-    <td class="rowodd" valign="top" nowrap><b>0.41</b></td>
-    <td class="rowodd" valign="top" nowrap><i>2006-08-30</i></td>
-    <td class="rowodd" valign="top" nowrap>6.0</td>
-    <td class="rowodd" valign="top"><i><a href="/account/profile.php?user_id=6016">Eric Van Dewoestine</a></i></td>
-    <td class="rowodd" valign="top" width="2000">Initial upload</td>
+    <td class="roweven" valign="top" width="2000">Initial upload</td>
 </tr>
 </table>
 <!-- finish off the framework -->
@@ -249,6 +257,7 @@
         </tr>
       </table>
     </td>
+
   </tr>
 </table>
 
@@ -287,8 +296,7 @@
           </td>
 
     <td align="right" valign="top">
-      	<a href="http://www.webconceptgroup.net"><img src="/images/logo_sponsor_wcg.jpg" width="131" height="30" border="0" alt="Sponsored by Web Concept Group Inc."></a>
-	<a href="http://sourceforge.net"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=8&type=1" width="88" height="31" border="0" alt="SourceForge.net Logo" /></a>
+      		<a href="http://sourceforge.net" rel="nofollow"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=8&type=1" width="88" height="31" border="0" alt="SourceForge.net Logo" /></a>
     </td>
 
     <td><img src="/images/spacer.gif" width="5" height="1" alt=""></td>

Modified: trunk/packages/vim-scripts/plugin/supertab.vim
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim-scripts/plugin/supertab.vim?rev=1285&op=diff
==============================================================================
--- trunk/packages/vim-scripts/plugin/supertab.vim (original)
+++ trunk/packages/vim-scripts/plugin/supertab.vim Fri Dec  5 16:11:24 2008
@@ -1,13 +1,12 @@
 " Author:
 "   Original: Gergely Kontra <kgergely at mcl.hu>
-"   Current:  Eric Van Dewoestine <ervandew at yahoo.com> (as of version 0.4)
+"   Current:  Eric Van Dewoestine <ervandew at gmail.com> (as of version 0.4)
 "   Please direct all correspondence to Eric.
-" Version: 0.45
+" Version: 0.46
 "
 " Description: {{{
 "   Use your tab key to do all your completion in insert mode!
 "   You can cycle forward and backward with the <Tab> and <S-Tab> keys
-"   (<S-Tab> will not work in the console version)
 "   Note: you must press <Tab> once to be able to cycle back
 "
 "   http://www.vim.org/scripts/script.php?script_id=1643
@@ -50,7 +49,7 @@
 "   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 " }}}
 
-if exists('complType') "Integration with other completion functions.
+if exists('complType') " Integration with other completion functions.
   finish
 endif
 
@@ -59,9 +58,38 @@
   " Used to set the default completion type.
   " There is no need to escape this value as that will be done for you when
   " the type is set.
-  " Ex.  let g:SuperTabDefaultCompletionType = "<C-X><C-U>"
+  " Ex.  let g:SuperTabDefaultCompletionType = "<c-x><c-u>"
+  "
+  " Note that a special value of 'context' is supported which will result in
+  " super tab attempting to use the text preceding the cursor to decide which
+  " type of completion to attempt.  Currently super tab can recognize method
+  " calls or attribute references via '.', '::' or '->', and file path
+  " references containing '/'.
+  " Ex. let g:SuperTabDefaultCompletionType = 'context'
+  " /usr/l<tab>  # will use filename completion
+  " myvar.t  # will use user completion if completefunc set, or omni
+  "          # completion if omnifunc set.
+  " myvar->  # same as above
+  "
+  " When using context completion, super tab will fall back to a secondary
+  " default completion type set by g:SuperTabContextDefaultCompletionType.
   if !exists("g:SuperTabDefaultCompletionType")
-    let g:SuperTabDefaultCompletionType = "<C-P>"
+    let g:SuperTabDefaultCompletionType = "<c-p>"
+  endif
+
+  " Sets the default completion type used when g:SuperTabDefaultCompletionType
+  " is set to 'context' and the text preceding the cursor does not match any
+  " patterns mapped to other specific completion types.
+  if !exists("g:SuperTabContextDefaultCompletionType")
+    let g:SuperTabContextDefaultCompletionType = "<c-p>"
+  endif
+
+  " When 'context' completion is enabled, this setting can be used to fallback
+  " to g:SuperTabContextDefaultCompletionType as the default for files whose
+  " file type occurs in this configured list.  This allows you to provide an
+  " exclusion for which 'context' completion is not activated.
+  if !exists("g:SuperTabContextFileTypeExclusions")
+    let g:SuperTabContextFileTypeExclusions = []
   endif
 
   " Used to set a list of variable, completion type pairs used to determine
@@ -69,10 +97,13 @@
   " variable is non-zero and non-empty then the associated completion type
   " will be used.
   " Ex. To use omni or user completion when available, but fall back to the
-  " global default otherwise.
-  "   let g:SuperTabDefaultCompletionTypeDiscovery = "&omnifunc:<C-X><C-O>,&completefunc:<C-X><C-U>"
+  " global default otherwise:
+  "   let g:SuperTabDefaultCompletionTypeDiscovery = [
+  "       \ "&completefunc:<c-x><c-u>",
+  "       \ "&omnifunc:<c-x><c-o>",
+  "     \ ]
   if !exists("g:SuperTabDefaultCompletionTypeDiscovery")
-    let g:SuperTabDefaultCompletionTypeDiscovery = ""
+    let g:SuperTabDefaultCompletionTypeDiscovery = []
   endif
 
   " Determines if, and for how long, the current completion type is retained.
@@ -122,6 +153,15 @@
     let g:SuperTabMappingBackward = '<s-tab>'
   endif
 
+  " Sets the key mapping used to insert a literal tab where supertab would
+  " otherwise attempt to kick off insert completion.
+  " The default is '<c-tab>' (ctrl-tab) which unfortunately might not work at
+  " the console.  So if you are using a console vim and want this
+  " functionality, you'll have to change it to something that is supported.
+  if !exists("g:SuperTabMappingTabLiteral")
+    let g:SuperTabMappingTabLiteral = '<c-tab>'
+  endif
+
   " Sets whether or not to pre-highlight first match when completeopt has
   " the popup menu enabled and the 'longest' option as well.
   " When enabled, <tab> will kick off completion and pre-select the first
@@ -139,22 +179,22 @@
     \ "Hit <CR> or CTRL-] on the completion type you wish to switch to.\n" .
     \ "Use :help ins-completion for more information.\n" .
     \ "\n" .
-    \ "|<C-N>|      - Keywords in 'complete' searching down.\n" .
-    \ "|<C-P>|      - Keywords in 'complete' searching up (SuperTab default).\n" .
-    \ "|<C-X><C-L>| - Whole lines.\n" .
-    \ "|<C-X><C-N>| - Keywords in current file.\n" .
-    \ "|<C-X><C-K>| - Keywords in 'dictionary'.\n" .
-    \ "|<C-X><C-T>| - Keywords in 'thesaurus', thesaurus-style.\n" .
-    \ "|<C-X><C-I>| - Keywords in the current and included files.\n" .
-    \ "|<C-X><C-]>| - Tags.\n" .
-    \ "|<C-X><C-F>| - File names.\n" .
-    \ "|<C-X><C-D>| - Definitions or macros.\n" .
-    \ "|<C-X><C-V>| - Vim command-line."
+    \ "|<c-n>|      - Keywords in 'complete' searching down.\n" .
+    \ "|<c-p>|      - Keywords in 'complete' searching up (SuperTab default).\n" .
+    \ "|<c-x><c-l>| - Whole lines.\n" .
+    \ "|<c-x><c-n>| - Keywords in current file.\n" .
+    \ "|<c-x><c-k>| - Keywords in 'dictionary'.\n" .
+    \ "|<c-x><c-t>| - Keywords in 'thesaurus', thesaurus-style.\n" .
+    \ "|<c-x><c-i>| - Keywords in the current and included files.\n" .
+    \ "|<c-x><c-]>| - Tags.\n" .
+    \ "|<c-x><c-f>| - File names.\n" .
+    \ "|<c-x><c-d>| - Definitions or macros.\n" .
+    \ "|<c-x><c-v>| - Vim command-line."
   if v:version >= 700
     let s:tabHelp = s:tabHelp . "\n" .
-      \ "|<C-X><C-U>| - User defined completion.\n" .
-      \ "|<C-X><C-O>| - Omni completion.\n" .
-      \ "|<C-X>s|     - Spelling suggestions."
+      \ "|<c-x><c-u>| - User defined completion.\n" .
+      \ "|<c-x><c-o>| - Omni completion.\n" .
+      \ "|<c-x>s|     - Spelling suggestions."
   endif
 
   " set the available completion types and modes.
@@ -172,7 +212,7 @@
 
 " CtrlXPP() {{{
 " Handles entrance into completion mode.
-function! CtrlXPP()
+function! CtrlXPP ()
   if &smd
     echo '' | echo '-- ^X++ mode (' . s:modes . ')'
   endif
@@ -244,22 +284,22 @@
 
   if !exists("b:SuperTabDefaultCompletionType")
     " loop through discovery list to find the default
-    if g:SuperTabDefaultCompletionTypeDiscovery != ''
-      let dlist = g:SuperTabDefaultCompletionTypeDiscovery
-      while dlist != ''
-        let pair = substitute(dlist, '\(.\{-}\)\(,.*\|$\)', '\1', '')
-        let dlist = substitute(dlist, '.\{-}\(,.*\|$\)', '\1', '')
-        let dlist = substitute(dlist, '^,', '\1', '')
-
+    if !empty(g:SuperTabDefaultCompletionTypeDiscovery)
+      " backward compatiability with old string value.
+      if type(g:SuperTabDefaultCompletionTypeDiscovery) == 1
+        let dlist = split(g:SuperTabDefaultCompletionTypeDiscovery, ',')
+      else
+        let dlist = g:SuperTabDefaultCompletionTypeDiscovery
+      endif
+      for pair in dlist
         let var = substitute(pair, '\(.*\):.*', '\1', '')
         let type = substitute(pair, '.*:\(.*\)', '\1', '')
-
         exec 'let value = ' . var
         if value !~ '^\s*$' && value != '0'
           let b:SuperTabDefaultCompletionType = type
           break
         endif
-      endwhile
+      endfor
     endif
 
     " fallback to configured default.
@@ -306,7 +346,7 @@
       let value = strpart(value, 1)
     endif
 
-    " keyword values is an ascii number range
+    " keyword values in an ascii number range
     if value =~ '[0-9]\+-[0-9]\+'
       let charnum = char2nr(a:char)
       exec 'let start = ' . substitute(value, '\([0-9]\+\)-.*', '\1', '')
@@ -347,7 +387,7 @@
   endif
 endfunction " }}}
 
-" s:SetDefaultCompletionType () {{{
+" s:SetDefaultCompletionType() {{{
 function! s:SetDefaultCompletionType ()
   if exists('b:SuperTabDefaultCompletionType')
     call SuperTabSetCompletionType(b:SuperTabDefaultCompletionType)
@@ -355,31 +395,56 @@
 endfunction " }}}
 
 " s:SuperTab(command) {{{
-" Used to perform proper cycle navigtion as the user requests the next or
+" Used to perform proper cycle navigation as the user requests the next or
 " previous entry in a completion list, and determines whether or not to simply
 " retain the normal usage of <tab> based on the cursor position.
-function! s:SuperTab(command)
+function! s:SuperTab (command)
   if s:WillComplete()
     let key = ''
     " highlight first result if longest enabled
     if g:SuperTabLongestHighlight && !pumvisible() && &completeopt =~ 'longest'
-      let key = (b:complType == "\<C-P>") ? "\<C-P>" : "\<C-N>"
+      let key = (b:complType == "\<c-p>") ? "\<c-p>" : "\<c-n>"
     endif
 
     " exception: if in <c-p> mode, then <c-n> should move up the list, and
     " <c-p> down the list.
-    if a:command == 'p' && b:complType == "\<C-P>"
-      return "\<C-N>"
-    endif
+    if a:command == 'p' &&
+      \ (b:complType == "\<c-p>" ||
+      \   (b:complType == 'context' &&
+      \    tolower(g:SuperTabContextDefaultCompletionType) == '<c-p>'))
+      return "\<c-n>"
+    endif
+
+    if b:complType == 'context'
+      if index(g:SuperTabContextFileTypeExclusions, &ft) == -1
+        let curline = getline('.')
+        let cnum = col('.')
+        let synname = synIDattr(synID(line('.'), cnum - 1, 1), 'name')
+        if curline =~ '.*/\w*\%' . cnum . 'c' ||
+          \ ((has('win32') || has('win64')) && curline =~ '.*\\\w*\%' . cnum . 'c')
+          return "\<c-x>\<c-f>" . key
+        elseif curline =~ '.*\(\w\|[\])]\)\(\.\|::\|->\)\w*\%' . cnum . 'c' &&
+          \ synname !~ '\(String\|Comment\)'
+          if &completefunc != ''
+            return "\<c-x>\<c-u>" . key
+          elseif &omnifunc != ''
+            return "\<c-x>\<c-o>" . key
+          endif
+        endif
+      endif
+      exec "let complType = \"" . escape(g:SuperTabContextDefaultCompletionType, '<') . "\""
+      return complType . key
+    endif
+
     return b:complType . key
   endif
 
-  return "\<Tab>"
+  return "\<tab>"
 endfunction " }}}
 
 " s:SuperTabHelp() {{{
 " Opens a help window where the user can choose a completion type to enter.
-function! s:SuperTabHelp()
+function! s:SuperTabHelp ()
   let winnr = winnr()
   if bufwinnr("SuperTabHelp") == -1
     botright split SuperTabHelp
@@ -410,7 +475,7 @@
   let b:winnr = winnr
 endfunction " }}}
 
-" s:WillComplete () {{{
+" s:WillComplete() {{{
 " Determines if completion should be kicked off at the current location.
 function! s:WillComplete ()
   let line = getline('.')
@@ -429,7 +494,7 @@
   endif
 
   " In keyword completion mode and no preceding word characters.
-  "if (b:complType == "\<C-N>" || b:complType == "\<C-P>") && !s:IsWordChar(prev_char)
+  "if (b:complType == "\<c-n>" || b:complType == "\<c-p>") && !s:IsWordChar(prev_char)
   "  return 0
   "endif
 
@@ -437,19 +502,22 @@
 endfunction " }}}
 
 " Key Mappings {{{
-  im <C-X> <C-r>=CtrlXPP()<CR>
+  " map a regular tab to ctrl-tab (note: doesn't work in console vim)
+  exec 'inoremap ' . g:SuperTabMappingTabLiteral . ' <tab>'
+
+  im <c-x> <c-r>=CtrlXPP()<cr>
 
   " From the doc |insert.txt| improved
-  exec 'im ' . g:SuperTabMappingForward . ' <C-n>'
-  exec 'im ' . g:SuperTabMappingBackward . ' <C-p>'
+  exec 'im ' . g:SuperTabMappingForward . ' <c-n>'
+  exec 'im ' . g:SuperTabMappingBackward . ' <c-p>'
 
   " After hitting <Tab>, hitting it once more will go to next match
-  " (because in XIM mode <C-n> and <C-p> mappings are ignored)
+  " (because in XIM mode <c-n> and <c-p> mappings are ignored)
   " and wont start a brand new completion
-  " The side effect, that in the beginning of line <C-n> and <C-p> inserts a
+  " The side effect, that in the beginning of line <c-n> and <c-p> inserts a
   " <Tab>, but I hope it may not be a problem...
-  ino <C-n> <C-R>=<SID>SuperTab('n')<CR>
-  ino <C-p> <C-R>=<SID>SuperTab('p')<CR>
+  ino <c-n> <c-r>=<SID>SuperTab('n')<cr>
+  ino <c-p> <c-r>=<SID>SuperTab('p')<cr>
 " }}}
 
 " Command Mappings {{{




More information about the pkg-vim-maintainers mailing list