Vim: C++ 자동 헤더 추가/삭제
설명
- https://github.com/quark-zju/vim-cpp-auto-include
- C++ 자동 헤더 추가/삭제해주는 플러그인
설치
dnf install rubycurl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vimvim ~/.vimrc
call plug#begin()
Plug 'quark-zju/vim-cpp-auto-include'
call plug#end()
autocmd BufWritePre ~/**.cpp :ruby CppAutoInclude::process
vim 실행 후 :PlugInstall 입력
확인
- 코드 작성 후 저장 시 자동 헤더 추가/삭제
- before
int main(void) {
vector<int> test;
return 0;
}
- after
#include <vector>
using namespace std;
int main(void) {
vector<int> test;
return 0;
}