2

Many times I have come across situations where I need to repeat a code template several times, usually it's boiler plate code. The only thing that would change between different blocks is a few parameter names, which are peppered throughout the block. Is it possible to automate this in Vim without much effort?

1
  • 2
    Neosnippet or Snipmate seem to be what you're looking for. That said, tool recommendations are off-topic on Stack Overflow. Commented Feb 28, 2014 at 6:50

1 Answer 1

4

snippets are like the built-in :abbreviate on steroids, usually with parameter insertions, mirroring, and multiple stops inside them. One of the first, very famous (and still widely used) Vim plugins is snipMate (inspired by the TextMate editor); unfortunately, it's not maintained any more; though there is a fork. A modern alternative (that requires Python though) is UltiSnips. There are more, see this list on the Vim Tips Wiki.

There are three things to evaluate: First, the features of the snippet engine itself, second, the quality and breadth of snippets provided by the author or others; third, how easy it is to add new snippets.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.