菜鸡一个。

vim考场配置

2020-10-23 16:31:52


syntax on
set ruler
"" 开启行号
set nu

"" 调整缩进
set autoindent
set cindent
set ts=4
set shiftwidth=4
set softtabstop=4

"" 搜索高亮
set hlsearch

"" 括号配对
inoremap { {}<ESC>i
inoremap ( ()<ESC>i
inoremap [ []<ESC>i

"" 符号配对
inoremap " ""<ESC>i
inoremap ' ''<ESC>i

""一键编译/运行
map <F5> <ESC>:w<CR>:!clear&&g++ "%" -o "%<" -g -lm -Wall -std=c++11<CR>
map <F6> <ESC>:w<CR>:!clear&&time "./%<"<CR>

""开启鼠标支持
set mouse=a