标签:vim
syntax on "高亮 "colo torte "配色 set guifont=Microsoft_YaHei_Mono:h11 "字体 set lines=26 columns=93 "gvim窗口大小 "set nu "行号开关 set history=100000 "最大历史 set autoindent "自动缩进 set tabstop=4 "一个TAB长度 set softtabstop=4 "退格键的时候退回缩进的长度 set shiftwidth=4 "每一级缩进的长度 set smarttab "自动缩进 set cindent "C风格自动缩进 set nobackup "不生成备份文件 set noswapfile "不生成swap文件 set mouse=a "光标定位到鼠标位置 "C,C++,Java 按F5编译运行 map <F5> :call CompileRun()<CR> func! CompileRun() exec "w" if &filetype == 'c' exec "!g++ -o run %" " exec "!run" elseif &filetype == 'cpp' exec "!g++ -o run %" " exec "!run" elseif &filetype == 'java' exec "!javac -d .\\bin %" exec "!java -cp .\\bin %<" elseif &filetype == 'sh' :!./% endif endfunc "imap <c-]> {<cr>}<c-o>O<left><right> map <F2> :call SetTitle()<CR> func SetTitle() let l = 0 let l = l + 1 | call setline(l,'#include <bits/stdc++.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,'}') let l = l + 1 | call setline(l,'//Last modified : '.strftime("%Y-%m-%d %H:%M")) endfunc
标签:vim
原文地址:http://blog.csdn.net/acvay/article/details/44978131