gerw / vim-latex-suite

71 stars 16 forks source link

Make vim-latex-suite look up for *.tex templates in a custom folder #24

Closed cristobaltapia closed 8 years ago

cristobaltapia commented 8 years ago

I don't know if this is the best way to achieve this, but I like the idea of being able to decide where to put the templates (I didn't find this functionality at least). Do you think this would be useful to others? It works like this: the global variable Tex_CustomTemplateFolder has to be set to the location of the folder that will be used to store the templates. If this variable is not set, then it falls-back to the default location.

gerw commented 8 years ago

The change in ftplugin/latex-suite/templates.vim is not correct: line 21 has to be replaced by an endif.

Moreover, the three changes in ftplugin/latex-suite/templates.vim are (almost) identical. You might replace these snippets by a call to a new function, e.g., Tex_FindInTemplateDir.

Further, it would be nice, if you could add some documentation, at least mention that the feature is undocumented in README.md.

gerw commented 8 years ago

I like the idea of having the templates in a separate directory.

cristobaltapia commented 8 years ago

Sorry for the errors there... its been a while since the last time I did some vim scripting :P I'll work on this then.

gerw commented 8 years ago

I realized that it is already possible to add templates to .vim/ftplugins/latex-suite/templates/ even if the latex-suite is actually installed in another directory (by using, e.g., pathogen). Would this be sufficient for you?

cristobaltapia commented 8 years ago

This would not be sufficient for me, since I intend to locate the templates in a shared directory. This way different people can use the same directory in a network. This is what I want to do at my work. I have already made the changes, now I have to add documentation. I will do this in the next days ;)

cristobaltapia commented 8 years ago

Ups... sorry for the commit-mess. I will create another pull request with only one commit.

gerw commented 8 years ago

I will have a look on the other pull request soon.