vim-templates
vim-templates copied to clipboard
Macro processing system
Some dynamic stuff handling would be great.
PR coming
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?
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?