Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

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

Closed
kirilligum opened this Issue Nov 2, 2012 · 2 comments

Comments

Projects
None yet
3 participants

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})
Collaborator

MarcWeber commented Nov 2, 2012

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
Collaborator

ajzafar commented Mar 19, 2013

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 Mar 19, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment