https://github.com/yohannfra/vim-protect-header
A simple vim plugin to quickly protect c/c++ header files
https://github.com/yohannfra/vim-protect-header
c cpp plugin vim
Last synced: 2 months ago
JSON representation
A simple vim plugin to quickly protect c/c++ header files
- Host: GitHub
- URL: https://github.com/yohannfra/vim-protect-header
- Owner: Yohannfra
- License: mit
- Created: 2019-12-03T13:15:45.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-04-21T17:53:34.000Z (about 2 years ago)
- Last Synced: 2025-07-06T23:38:17.818Z (12 months ago)
- Topics: c, cpp, plugin, vim
- Language: Vim Script
- Size: 24.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Vim-Protect-Header
A simple vim plugin to quickly protect c/c++ header files
Example: \

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