Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

pressing tab in snipmate plugin in vim triples the input #111

Closed
kirilligum opened this Issue · 2 comments

3 participants

@kirilligum

http://stackoverflow.com/questions/13187387/pressing-tab-in-snipmate-plugin-in-vim-triples-the-input

Snipmate triples my input. I do the following:

template[press tap here]

I get an expansion:

template <class T = >
class  {
public:
  () {}
  ~() {}
private:
};

which simply follows the definition in ~/.vim/vim-addons/snipmate-snippets/snippets/cpp.snippets

# template
snippet template
    template <class ${1:T} = ${2}>
    class ${3:`Filename('$3', 'name')`} {
    public:
        $3() {}
        ~$3() {}
    private:
    };

I have no problem with inputting {$1} and {$2} tab stops but when I enter "lala " for {$3}, i get

template <class T = int>
class lala lala  alal {
public:
  lala  alal() {}
  ~lala  alal() {}
private:
};

snipmate syntax is pretty simple. i'm confused on what i'm doing wrong.

I installed snipmate through VAM

call vam#ActivateAddons(['snipmate-snippets'], {'auto_install' : 0})
@MarcWeber
Collaborator

If you have trouble with its expansion - give ultisnips or xptemlate a try. snipmate is known to have some issues - just not enough to make me switch. At least I don't have time to work on it in the near future - maybe somebody else has.

For your next posts keep in mind that you can prefix lines with 4 spaces to make them look like code:

like this example
@ajzafar
Collaborator

The problem is the Filename('$3', 'name'). The $3 should be $1, if I understand your intent correctly. Changing that should remove the problem. Having said that, perhaps SnipMate should be acting a bit saner in such an event.

@kirilligum kirilligum closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.