Pepcy 的常用 Vim 配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
syntax on
set nocompatible
set backspace=2
set tabstop=4
set softtabstop
set shiftwidth=4
set expandtab
set smarttab
set number
set ruler
set cursorline
set scrolloff=3
set showmatch
set magic
set showcmd
set history=1000
set hlsearch
set incsearch
set ignorecase
set smartcase
set cindent
set smartindent
set autoindent
set mouse=a

noremap <C-z> 0
inoremap <C-z> <C-o>0
noremap <C-x> $
inoremap <C-x> <C-o>$

inoremap ( ()<LEFT>
inoremap [ []<LEFT>
inoremap {<CR> {}<LEFT><CR><CR><UP><TAB>

noremap <C-a>gg0vG$

noremap <F5> :w<CR>:!g++ % -o %< -O2 -lm<CR>
inoremap <F5> <ESC>:w<CR>:!g++ % -o %< -O2 -lm<CR>

map <C-p> i#include <cstdio><CR>#include <cstring><CR>#include <climits>#include <stack><CR>#include <queue><CR>#include <vector><CR>#include <algorithm><CR><CR>int main(<RIGHT> {<CR><CR>return 0;<UP><ESC>