1

In sublime text 3, if I'm editing a file.py and I type class it will automatically create this for me

class ClassName(object):
    """docstring for ClassName"""
    def __init__(self, arg):
        super(ClassName, self).__init__()
        self.arg = arg

If I'm editing a C++ file, obiously it's not the same. How to do that in vim? I already have jedi-vim it's awesome but doesn't do that.

1

1 Answer 1

1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .