Vim Configuration in ACM

Source: Internet
Author: User


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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.