Snipmate plugin in vim inserts a carriage return in all snippets

1

I'm using snipmate plugin in vim, and started creating some snippets to use in Zope.

Unfortunately, the snippets I'm creating are some html attributes, and everytime I call the snippet, it works as expected but it inserts a carriage return after the snippet, and I have to return the end tag > to it's place everytime I run a snippet, thus losing productivity advantage in using snipmate.

How do I create a snippet that doesn't insert a carriage return after the snippet?

Somebody still uses you MS-DOS

Posted 2010-06-29T14:23:53.617

Reputation: 4 143

can't answer to your question, but i changed the template-system over to xtp-template (http://www.vim.org/scripts/script.php?script_id=2611)

– akira – 2010-06-29T14:28:38.197

Answers

1

My bad. When you create your own snippets in your file:

snippet snippet1
    snippet1

snippet snippet2
    snippet2

This "space" between snippets is reponsible for the extra carriage return. If I maintain my snippets file like this:

snippet snippet1
    snippet1
snippet snippet2
    snippet2

It works as expected. The carriage return was being used as a snippet as well.

Somebody still uses you MS-DOS

Posted 2010-06-29T14:23:53.617

Reputation: 4 143

I swear I can't see the difference between the two. – Rook – 2010-06-29T18:30:43.590

There's a carriage return between the two snippets in the first example, the second there isn't. Snipmate thinks the carriage return between two snippets definitions is from the first snippet and call it when you execute the snippet in vim. If you don't want a carriage return after your snippet, you shouldn't separate snippet definitions with carriage returns. – Somebody still uses you MS-DOS – 2010-06-29T19:43:11.433