Automatically insert or delete `#include`s for C++ code in vim.
Vim script
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
demo
plugin
README.md

README.md

Automatically insert or delete #includes for C++ code in vim.

vim-cpp-auto-include demo

Note

This plugin is intended to be simple and intended to be used on simple C++ files only.

Installation

Copy plugin/cpp_auto_include.vim to ~/.vim/plugin/.

Alternatively, with Vundle, add Bundle 'quark-zju/vim-cpp-auto-include' in ~/.vimrc and run BundleInstall in vim.

Usage

:w

Configuration

Only C++ files in /tmp are processed by default.

Add following line in your .vimrc to make your C++ code in /some/path/ processed when saving:

autocmd BufWritePre /some/path/**.cpp :ruby CppAutoInclude::process

If you want more control, feel free to edit the source :)