vim配置文件

set autoindent
set ts=4
colorscheme elflord
set nu
set mouse=a
set shiftwidth=4
set expandtab
map <F5> <ESC>:w <ESC>:!g++ % -O2 -std=c++11 && time ./a.out<CR>
map <C-D> <ESC>:w<CR>
map <C-p> <ESC>:set noautoindent<CR>
map <C-a> <ESC>:set autoindent<CR>
map <C-c> <ESC>:!cat %<CR>

考场操作

inoremap ( ()<LEFT>
inoremap [ []<LEFT>
inoremap { {}<LEFT>

转载自https://www.cnblogs.com/Delov/p/15158702.html
BY DELOV

colorscheme ron
set nu
set ruler
set mouse=a
set ts=4
set noswapfile
set autoindent
set statusline=WOW 
autocmd VimEnter * :hi clear TabLineFill
map <F5> <ESC>:w <CR> <ESC>:! g++ % -O2 -o 1 && time ./1<CR>
map <F6> <ESC>:w <CR> <ESC>:! g++ % -O2 -o 2 && time ./2<a.in<CR>
map <F7> <ESC>:w <CR> <ESC>:! g++ % -o gg -g && gdb gg<CR>
map <F8> <ESC>:tabedit .vimrc<CR>
map <F9> <ESC>:vsp a.in<CR>
map <C-p> <ESC>:vsp 
map <C-w> <ESC>:q<CR>
map <F4> <ESC>:! g++ data.cpp -o data && ./data<CR>
map <C-a> <ESC>:set autoindent<CR>
map <C-n> <ESC>:set noautoindent<CR>
map <C-c> <ESC>:w <CR> <ESC>:! cat %<CR>
map <C-e> <ESC>:wq<CR>
map <C-h> <ESC>:tabp<CR>
map <C-l> <ESC>:tabn<CR>
map <C-t> <ESC>:tabedit 
map <C-x> <ESC>:shell<CR>
map <F3> :call INIT()<CR>
func INIT()
	call append(line(".")+1, "#include<cstdio>")
	call append(line(".")+2, "#include<cmath>")
	call append(line(".")+3, "#include<cstring>")
	call append(line(".")+4, "#include<algorithm>")
	call append(line(".")+5, "using namespace std;")
	call append(line(".")+6, "")
	call append(line(".")+7, "const int maxn=1e5+10;")
	call append(line(".")+8, "")
	call append(line(".")+9, "#define gc if(++ip==ie)fread(ip=buf,1,SZ,stdin)")
	call append(line(".")+10, "const int SZ=1<<20;")
	call append(line(".")+11, "char buf[SZ],*ie=buf+SZ,*ip=ie-1;")
	call append(line(".")+12, "inline int read(){")
	call append(line(".")+13, "	gc;while(*ip<'-')gc;")
	call append(line(".")+14, "	bool f=*ip=='-';if(f)gc;")
	call append(line(".")+15, "	int x=*ip&15;gc;")
	call append(line(".")+16, "	while(*ip>'-'){x*=10;x+=*ip&15;gc;}")m
	call append(line(".")+17, "	return f ? -x : x;")
	call append(line(".")+18, "}")
	call append(line(".")+19, "")
endfun
colorscheme ron
set nu
set ruler
set mouse=a
set ts=4
set noswapfile
set autoindent
set statusline=this_window_is_active

autocmd VimEnter * :hi clear TabLineFill
map <F9> <ESC>:w <CR> <ESC>:! g++ % -o 1 -Wall -g<CR>
map <F8> <ESC>:w <CR> <ESC>:! g++ % -o
map <F7> <ESC>:! ./1 <CR>
map <F6> <ESC>:! ./1 
map <F5> <ESC>:w <CR> <ESC>:! g++ % -o 1 -Wall -g && ./1 <CR>
map <F2> <ESC>:set autoindent<CR>
map <F3> <ESC>:set noautoindent<CR>
map <C-n> <ESC>:vsp
map <F4> <ESC>:vsp .vimrc <CR>
map <C-e> <ESC>:w <CR>
map <C-z> <ESC>:u <CR>
map <C-w> <ESC>:q <CR>
map <C-t> <ESC>:tabedit
map <C-d> <ESC>:shell<CR>
map <C-p> <ESC>:!gnome-terminal<CR> <CR>
map <UP> <Nop>
map <DOWN> <Nop>
map <LEFT> <Nop>
map <RIGHT> <Nop>

原文地址:https://www.cnblogs.com/cdsidi/p/15095866.html