The VIM as the main editor of ACM for a long time, with the benefits of vim needless to say,
Here is a summary of the Vim configuration method in ACM, the configuration is directly written into the ~/.VIMRC can be.
14-line configuration for race:
Syntax onset cindentset nuset tabstop=4set shiftwidth=4set background=darkmap <C-A> ggvg "+ymap <F5>: Call Run () <cr>func! Run () Exec "W" exec "!g++-wall%-o%<" exec "!. /%< "Endfunc
Daily configuration:
Mostly run Java, a key to complete the header files, fonts and so on
Syntax onset cindentset mouse=aset tabstop=4set shiftwidth=4set nuset nocompatibleset showmodeset showcmdset ignorecase s Martcaseset hlsearchset autoindentset smarttabset smartindent "ColorScheme solarizedset background=darkset gfn=Source\ Code\ pro\ 14map <F5>: Call Run () <cr>func! Run () Exec "W" If &filetype is ' cpp ' | | &filetype is ' C ' | | &filetype is ' cc ' EXEC '!clang++-wall%-o%< ' exec '!. /%< "ElseIf &filetype is ' java ' exec"!javac\-d\. \% "Exec"!java\%< "Endifendfuncmap <C-A> ggvg" +ymap < F12>: Call Settitle () <cr>func settitle () Let L = 0let L = L + 1 | Call Setline (L, '/* *********************************************** ') let L = L + 1 | Call Setline (L, ' author:ckboss ') let L = L + 1 | Call Setline (L, ' Created time: '. Strftime ('%c ')) let L = L + 1 | Call Setline (L, ' File Name: '. Expand ('% '))-let L = L + 1 | Call Setline (L, ' ************************************************ */') let L = L + 1 | Call Setline (L, ") Let L = L + 1 | Call Setline (L, ' #include <iostream> ') let L = L + 1 | Call Setline (L, ' #include <cstdio> ') let L = L + 1 | Call Setline (L, ' #include <cstring> ') let L = L + 1 | Call Setline (L, ' #include <algorithm> ') let L = L + 1 | Call Setline (L, ' #include <string> ') let L = L + 1 | Call Setline (L, ' #include <cmath> ') let L = L + 1 | Call Setline (L, ' #include <cstdlib> ') let L = L + 1 | Call Setline (L, ' #include <vector> ') let L = L + 1 | Call Setline (L, ' #include <queue> ') let L = L + 1 | Call Setline (L, ' #include <set> ') let L = L + 1 | Call Setline (L, ' #include <map> ') 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, ' 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, '} ') Endfunc
Instructions for writing ACM code with VIM in a Linux system:
( Note: Use in terminal for best results)
1. Open Terminal mkdir new folder, touch new file
2. Vim Xxx.cpp and then write the code.
3. After writing, press <f5> directly, will automatically jump back to the terminal to compile and run, ctrl-c interrupt run and jump back to vim
4. After debugging <Ctrl-A> Copy the code to the Clipboard, submit
Kuangbin configuration of the Great God: Http://www.kuangbin.net/archives/vim-acmicpc
Vim Configuration in ACM