vim大法好,远离cb保平安,分享一下我的vim配置文件,正在下载vim只能简单的编辑,没有一些简单的快捷方式
额外又添加了一键生成模板的配置
设置的快捷键F2,一键生成模板van,
加上O2编译
set nu set history=1000000 set tabstop=4 set shiftwidth=4 set smarttab set cindent colo evening set showcmd set nobackup set noswapfile set mouse=a map <F6> :call CR()<CR> func! CR() exec "w" exec "!g++ -O2 -g % -o %<" exec "! %<" endfunc imap <c-]> {<cr>}<c-o>O<left><right> map <C-A> ggVG"+y "inoremap ( ()<LEFT> "inoremap [ []<LEFT> "inoremap { {}<LEFT> "inoremap " ""<LEFT> "inoremap ' ''<LEFT> map <F2> :call SetTitle()<CR> func SetTitle() let l = 0 let l = l + 1 | call setline(l,'/* ***********************************************') let l = l + 1 | call setline(l,'Author :mubaixu') 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 <stdio.h>') let l = l + 1 | call setline(l,'#include <string.h>') let l = l + 1 | call setline(l,'#include <iostream>') let l = l + 1 | call setline(l,'#include <algorithm>') 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,'#include <string>') let l = l + 1 | call setline(l,'#include <math.h>') let l = l + 1 | call setline(l,'#include <stdlib.h>') let l = l + 1 | call setline(l,'#include <time.h>') 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