Frage

In Vim, after I installed vim-snipmates, I want to use this snippet to auto complete brackets.

snippet (
    (${1})${2} 

But, I encountered a problem, if I input things like this:

enter image description here

The last bracket is completed by the snippet when I input the first ( and tab, and this time when I press tab, I want to add another ) to the end and make things like this:

enter image description here

But, it turns out the Vim thinks I want to input a ) to finish everything, so it replaces the last ), and there is still one ) at the end of the line.

I want to know which plugin did this replacement and how can I disable it.

.vimrc

Bundle "MarcWeber/vim-addon-mw-utils"
Bundle "tomtom/tlib_vim"
Bundle "garbas/vim-snipmate"
Bundle "honza/vim-snippets"

I feel it's very hard to describe it.

War es hilfreich?

Lösung 2

The second < tab > didn't work like define but jump to the ${2}

Andere Tipps

Rather than using a snippet plugin, say Snipmate, Neosnippet or Ultisnips, the job of auto close parens, brackets or quotes )}]"' is better suited for an autoclose plugin, such as Delimitmate or autopairs.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top