I have been using Vim with the snipMate plugin for creating HTML code. This is the code I want to type quickly:
<ul>
<li><a href="this.html">that</a></li>
</ul>
So I start in insert mode typing ul
Tabli
Tab but then when I try typing a
tab to create the link snippet it doesn't work, it moves to the end of the line (which is what the snippet says to do).
I have tried to escape the snip by pressing Esc, but once I enter insert mode Tab still takes me to the end of the line. Currently the best way I can get it to work is by accepting the Tab to the end of the line, moving backwards then insert. Is this method the most efficient way of doing this? How do you escape a snippet?
I also have the following snippet for a
in html.snippets
snippet a
<a href="${1:#}">${2:$1}</a>${3}
Pressing a
Tab puts me after the href="
and I type this.html
, the snippet puts this.html
before the </a>
. When I press Tab and then want to type over the second this.html
(like in TextMate) and so I type that
, but it leaves thathis.html
?