LucHermitte / lh-cpp

C&C++ ftplugins suite for Vim
Other
130 stars 10 forks source link

Use #pragma once instead of #ifndef in c++ template #12

Closed AndreasAZiegler closed 5 years ago

AndreasAZiegler commented 5 years ago

As I'm using #pragma once instead of #ifndef, I tried to change the C++ template file cpp_BuildTemplates.vim on lines 227, 228 and 327, 328 accordingly. Unfortunately this does not seem to work. What did I miss?

LucHermitte commented 5 years ago

cpp_BuildTemplates.vim is quite old stuff. I'm not sure that part is used anywhere any more. I'll need to eventually clean up this dead code.

What about overriding after/template/c/internals/c-header.template from mu-template?

You should just have to drop the replacement in ~/.vim/template/c/internals/ if I remember correctly. If you prefer, I can take care of this through an option.

AndreasAZiegler commented 5 years ago

I would highly appreciate if you could take car of this as I'm not yet that familiar with your plugin.

LucHermitte commented 5 years ago

You can set g:guard_headers_with to 'pragma' or to 'ifndef,pragma' from your .vimrc if you wish the option to be set globally for all your projects. If you wish to chose differently in different projects, you can have a look at https://github.com/LucHermitte/lh-vim-lib/blob/master/doc/Options.md#local-options

Let me know if the fix is OK (or not) for you.