Search code examples
vimsnipmate

Vim snipmate autocomplete conflict


I'm using Vim (7.2.445 on Debian Squeeze) with the vim-snipmate plugin (specially this fork of it - https://github.com/garbas/vim-snipmate)

One of the shortcuts you're meant to be able to do is Ctrl-R, Tab, in insert mode, to give you a list of all the available snippets. However although the list displays, the first item is automatically inserted into the file the moment I press Tab, regardless of the fact I haven't chosen it, also I can't use J or K or scroll up or down the list, or type in further characters to narrow the search.

This is my .vimrc:

syntax on
set shiftwidth=4
set tabstop=4
set autoindent
set smartindent
set cursorline
set ruler
if version >= 703
  set relativenumber
else
  set number
endif
inoremap jj <ESC>
set hlsearch
noremap  <Up> ""
noremap! <Up> <Esc>
noremap  <Down> ""
noremap! <Down> <Esc>
noremap  <Left> ""
noremap! <Left> <Esc>
noremap  <Right> ""
noremap! <Right> <Esc>
inoremap <M-o>       <Esc>o
inoremap <C-j>       <Down>
let g:ragtag_global_maps = 1
filetype plugin on

call pathogen#runtime_append_all_bundles()
call pathogen#helptags()

Solution

  • I realize this is probably not the answer you're looking for, but have you tried using other snippet plugins like XPTemplate or UltiSnips? I would post the direct links, but I don't have enough reputation yet :( You can find them easily at www.vim.org/scripts

    I've had similar troubles with snipMate and eventually solved them by switching over to XPTemplate. IMHO, both XPTemplate and UltiSnips are an improvement over snipMate, and in my experience (with XPTemplate), play along with other settings and plugins more nicely (not to mention the extra features).

    Here's a video of XPTemplate in action, and some general information on snippet plugins for vim.