A simple vim plugin to quickly protect c/c++ header files
Plug 'Yohannfra/Vim-Protect-Header'
git clone https://github.com/Yohannfra/Vim-Protect-Header/ ~/.vim/plugin/
You can call the function automatically when creating a .h/.hpp file.
insert this line in your .vimrc
autocmd BufNewFile *.h,*.hpp :Protect
If you want to add a comment after the endif so it looks like that
#ifndef MY_HEADER_HPP
#define MY_HEADER_HPP
#endif // MY_HEADER_HPP
Add this line to your .vimrc
let g:Protect_Header_Endif_Comment = 1
:Protect
This project is licensed under the terms of the MIT license.