Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
    
can't answer to your question, but i changed the template-system over to xtp-template (vim.org/scripts/script.php?script_id=2611) –  akira Jun 29 '10 at 14:28

1 Answer 1

up vote 0 down vote accepted

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.

share|improve this answer
    
I swear I can't see the difference between the two. –  ldigas Jun 29 '10 at 18:30
    
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 Jun 29 '10 at 19:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.