vim-template icon indicating copy to clipboard operation
vim-template copied to clipboard

why if g:templates_global_name_prefix be definded to other string, the built-in templates will not be searched?

Open Freed-Wu opened this issue 4 years ago • 2 comments

Freed-Wu avatar Apr 08 '20 10:04 Freed-Wu

and the default value of g:templates_global_name_prefix should not be '=template=' but '=template=.', because the complete of command ':Template' is 'py', 'cpp', etc, if :Template py, =template=.py will not be searched. but if set g:templagtes_global_name_prefix to '=template=.', it can do.

but looks like when i set g:templates_global_name_prefix to '', the build-in templates will not be found. but user usually to download others template from github or other place, this templates will not start with '=template='. to make it be searched. i must set g:templates_global_name_prefix to '', but it make the build-in templates cannot work.

thanks!

Freed-Wu avatar Apr 08 '20 10:04 Freed-Wu

That's because the g:templates_global_name_prefix is applied to all attempts of searching templates, even for the build-in ones. I suppose that the best solution, which would also allow using templates from multiple sources more easily, would be allowing multiple prefixes, then something like the following would work for you (I think):

let g:templates_global_name_prefix = ['', '=template=']

How does that sound?

aperezdc avatar Apr 08 '20 22:04 aperezdc

I create a plugin for myself to replace this plugin, so I must close all my issues of this repo because I cannot reproduce any of them.

Freed-Wu avatar Feb 28 '23 17:02 Freed-Wu