1 filetype plugin indent on 2 set completeopt=preview,menu 3 set syntax=on 4 set mouse=a 5 set cindent 6 set tabstop=4 7 set nu 8 set hlsearch 9 set smarttab 10 set showmatch 11 set matchtime=0 12 set report=0 13 14 :inoremap { {}<esc>i 15 :inoremap {<CR> {<CR>}<ESC>O 16 :inoremap } <c-r>=Close('}')<CR> 17 function Close(char) 18 if getline('.')[col('.')-1] == a:char 19 return "<Right>" 20 else 21 return a:char 22 endif 23 endfunction 24 25 map <C-A> ggVG"+y 26 map <F5> :call Run()<CR> 27 func! Run() 28 exec "w" 29 exec "!g++ -Wall % -o %<" 30 exec "!./%<" 31 endfunc
F5 to complier and run
ctrl+a to copy all