Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functions inside snippets #31

Closed
lono175 opened this issue Jun 6, 2010 · 3 comments
Closed

Functions inside snippets #31

lono175 opened this issue Jun 6, 2010 · 3 comments

Comments

@lono175
Copy link

lono175 commented Jun 6, 2010

Hi,
I recently switched from snipMate to neocomplcache.
I like the snippet system of neocomplcahce because it supports nested snippet.
Nevertheless, I found that neocomplcache does not support function call inside a snippet.
For example, the following snippet in snipMate would use the current file name to be the default include file name.


snippet Inc
#include "${1:Filename("$1.h")}"


Do you have any future plan to support this functionality?
Thank you for your great work.

@Shougo
Copy link
Owner

Shougo commented Jun 7, 2010

The reason why it does not work is that probably Filename() is not defined.
I had implemented functions of snipMate, but it deleted.
Because there was an opinion to be bad. Please define it in your .vimrc.

@Shougo
Copy link
Owner

Shougo commented Jun 7, 2010

This snippet works.

snippet Inc
    #include "${1:`getcwd()`}"

@lono175
Copy link
Author

lono175 commented Jun 8, 2010

Thanks. I tried the following, and it gives me what I want.

snippet Inc
       #include "${1:`expand("%:t:r")`}.h"

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants