標籤: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' :!./% endifendfunc"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設定檔