Ps:f7 Compile F9 run F8 call gdb F12 Form Initial header (C + +) (both in normal mode)
CTRL + A Select all plus copy (normal mode)
CTRL + Z Auto Indent (normal mode)
Compile option added-std=c++11-o2
Set Nocompatiblesource $VIMRUNTIME/vimrc_example.vimsource $VIMRUNTIME/mswin.vimbehave mswinset Diffexpr=mydiff () function Mydiff () Let opt = '-a--binary ' if &diffopt =~ ' icase ' | Let opt = opt. '-I ' | endif if &diffopt =~ ' Iwhite ' | Let opt = opt. '-B ' | endif let arg1 = v:fname_in if arg1 =~ ' | Let arg1 = ' "'. Arg1. ' ' ' | endif Let arg2 = v:fname_new if arg2 =~ ' | Let arg2 = ' "'. Arg2. ' ' ' | endif Let Arg3 = v:fname_out if Arg3 =~ ' | Let Arg3 = ' "'. Arg3. ' ' ' | endif Let eq = ' if $VIMRUNTIME =~ ' if &sh =~ ' \<cmd ' let cmd = ' "". $VIMRUNTIME. ' \diff ' ' let's eq = ' ' else let cmd = substitute ($VIMRUNTIME, ' ', ' "', '). ' \diff "' endif else let cmd = $VIMRUNTIME. ' \diff ' endif silent execute '! '. Cmd. ‘ ‘ . Opt. Arg1. ‘ ‘ . Arg2. ' > '. Arg3. Eqendfunctionsyntax onset nuset nobackupset noswapfileset cindentset mouse=aset tabstop=8set shiftwidth=8set background =darkcolorscheme Eveningset Guifont=courier_new:h10map <C-A> GGVG "+ymap <C-Z> gg=gmap <F7>: Call CMP () <cr>func! CMP () Exec "W" exec "!g++-o2-std=c++11%-o%<" Endfuncmap <F8>: Call Rungdb () <cr>func! Rungdb () Exec "W" exec "!g++-wall-o2-std=c++11%-g-o%<" exec "!gdb ./%<" Endfuncmap <F9>: Call R Un () <cr>func! Run () Exec "!%<" Endfuncmap <F12>: Call Settitle () <cr>func settitle () Let L = 0let L = L + 1 | Call Setline (L, ' #include <bits/stdc++.h> ') let L = L + 1 | Call Setline (L, ") let L = L + 1 | Call Setline (L, ' using namespace std; ') Let L = L + 1 | Call Setline (L, ") let L = L + 1 | Call Setline (L, ' #define REP (I, A, b) for (Int. I (a); I <= (b); ++i) ') let L = L + 1 | Call Setline (L, ") let L = L + 1 | Call Setline (l, ' int main () {') let L = L + 1 | Call Setline (L, ") let L = L + 1 | Call Setline (L,") let L = L + 1 | Call Setl INE (L, ') let L = L + 1 | Call Setline (L, ' return 0; ') Let L = L + 1 | Call Setline (L, '} ') let L = L + 1 | Call Setline (L, ") Let L = L + 1 | Call Setline (L, ') Endfunc
Vim configuration file