Skip to content

Instantly share code, notes, and snippets.

@tungd
Created March 5, 2011 16:06
Show Gist options
  • Save tungd/856472 to your computer and use it in GitHub Desktop.
Save tungd/856472 to your computer and use it in GitHub Desktop.
Fix tab completion with Neocomplecache and SnipMate
diff --git a/plugin/snipMate.vim b/plugin/snipMate.vim
index ef03b12..b1738c6 100644
--- a/plugin/snipMate.vim
+++ b/plugin/snipMate.vim
@@ -159,8 +159,10 @@ fun! TriggerSnippet()
if exists('SuperTabKey')
call feedkeys(SuperTabKey) | return ''
endif
- call feedkeys("\<esc>a", 'n') " Close completion menu
- call feedkeys("\<tab>") | return ''
+ if !exists('g:neocomplcache_snipmate')
+ call feedkeys("\<esc>a", 'n') " Close completion menu
+ call feedkeys("\<tab>") | return ''
+ endif
endif
if exists('g:snipPos') | return snipMate#jumpTabStop(0) | endif
@@ -181,6 +183,11 @@ fun! TriggerSnippet()
call feedkeys(SuperTabKey)
return ''
endif
+
+ if exists('g:neocomplcache_snipmate') && (word != '')
+ call feedkeys("\<c-n>")
+ return ''
+ endif
return "\<tab>"
endf
@tungd
Copy link
Author

tungd commented Mar 5, 2011

Add one option g:neocomplcache_snipmate because plugin detection is not possible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment