Syntax on "highlight" colo torte "color set guifont=microsoft_yahei_mono:h11" font Set lines=26 columns=93 "gvim window Size" Set NU "line number switch set history=100000" Max historical set Autoindent "Auto indent set tabstop=4" a tab length set softtabstop=4 "backspace when the length of the indent is returned set Shiftwidt H=4 "The length of each indent set Smarttab" Auto indent set cindent "C style auto indent set nobackup" Do not generate backup file set Noswapfile "Do not generate swap file set mouse=a" cursor position to mouse location "C,c++,java Press F5 to compile and run map <F5>: Call Compilerun () <cr>func! Compilerun () Exec "W" if &filetype = = ' C ' exec "!g++-o run%" "Exec"!run "ElseIf &filetyp E = = ' cpp ' exec "!g++-o run%" "Exec"!run "elseif &filetype = = ' java ' exec"!javac-d. \\bi n% "exec"!JAVA-CP. \\bin%< "ElseIf &filetype = = ' sh ':!. /% ENDIFENDFUNC "IMAP <c-]> {<cr>}<c-o>o<left><right> map <F2>: Call Settitle() <CR> func settitle () Let L = 0 let L = L + 1 | Call Setline (L, ' #include <bits/stdc++.h> ') let L = L + 1 | Call Setline (L, ' using namespace std; ') 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, '//freopen ("In.txt", "R", stdin); "Let L = L + 1 | Call Setline (L, '//freopen ("OUT.txt", "w", stdout); ') let L = L + 1 | Call Setline (L, ") let L = L + 1 | Call Setline (L, ' return 0; ') let L = L + 1 | Call Setline (L, '} ') let L = L + 1 | Call Setline (L, '//last modified: '. Strftime ("%y-%m-%d%h:%m") endfunc
My VIM configuration file