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

Macro processing system #6

Open
pipoprods opened this issue Aug 12, 2016 · 2 comments
Open

Macro processing system #6

pipoprods opened this issue Aug 12, 2016 · 2 comments

Comments

@pipoprods
Copy link

Some dynamic stuff handling would be great.

PR coming

@ap
Copy link
Owner

ap commented Aug 15, 2016

Hi, thank you for the patch. I don’t think I’ll be accepting it in this form, sorry. The filename macro makes obvious sense, but your timestamp macro seems too specific to one particular use already. I think the requested feature makes sense but its design needs to be more generic.

The filetype-dependent macro mechanism can be written much more simply using :runtime (something like exe 'runtime' fnameescape(g:templates_path . a:filetype . '-macros.vim')) but it seems probably unnecessary in the first place: you can already use e.g. ~/after/ftplugin/html.vim to run a script for the html filetype. Is there something you can’t do that way, or not easily?

@pipoprods
Copy link
Author

No problem for me if you don’t accept my patch ;)

I’m not really used to vim programming (I didn’t know about ~/after/ftplugin mechanism).

The "problem" with placing macros in ~/after/ftplugin/html.vim is that they would require creating a file for each filetype, which is something I try to avoid, prefering generic methods.

What kind of more generic design would seem correct to you?

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

No branches or pull requests

2 participants