"Version: 1.0 by momodi@whuacm
"Modified by ghostboyzone@gmail.com
source $VIMRUNTIME/mswin.vim
behave mswin
imap <c-d> <c-o>dd
imap <cr> <cr><left><right>
map o o<left><right>
imap <c-]> {<cr>}<c-o>O<left><right>
noremap <f6> =a{
syn on
colo desert
filetype indent on
se ru nu ar sw=4 ts=4 noswf et sta nowrap ww=<,>,[,] gfn=Consolas:h12
autocmd BufEnter * lcd %:p:h
map <c-t> :tabnew<CR>
map <f9> :call CR()<CR><CR>
func CR()
exec 'update'
if filereadable(expand('%<').'.in')
exec '!start cmd /c _run %< < %<.in & pause'
else
exec '!start cmd /c _run %< & pause'
endif
endfunc
map <f2> :call SetTitle()<CR>Gkkk
func SetTitle()
let l = 0
let l = l + 1 | call setline(l, '/*')
let l = l + 1 | call setline(l, ' * Author: mybestwishes')
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, '#include <iostream>')
let l = l + 1 | call setline(l, '#include <cstdio>')
let l = l + 1 | call setline(l, '#include <cstdlib>')
let l = l + 1 | call setline(l, '#include <cstring>')
let l = l + 1 | call setline(l, '#include <cmath>')
let l = l + 1 | call setline(l, '#include <algorithm>')
let l = l + 1 | call setline(l, '#include <string>')
let l = l + 1 | call setline(l, '#include <vector>')
let l = l + 1 | call setline(l, '#include <stack>')
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 <time.h>')
let l = l + 1 | call setline(l, 'using namespace std;')
let l = l + 1 | call setline(l, 'const int maxint = -1u>>1;')
let l = l + 1 | call setline(l, '')
let l = l + 1 | call setline(l, 'int main() {')
let l = l + 1 | call setline(l, ' return 0;')
let l = l + 1 | call setline(l, '}')
let l = l + 1 | call setline(l, '')
endfunc
map<f4> :call AddComment()<cr>
func AddComment()
if matchstr(getline('.'), '[^ ]') == '/'
normal ^xx
else
normal ^i//
endif
endfunc
set printoptions=syntax:n,number:y,portrait:y
set guioptions+=b
"set encoding=utf-8
"set fileencodings=utf-8,gb2312,gb18030,gbk,ucs-bom,cp936,latin1
"set termencoding=utf-8
"set encoding=utf-8 fileencodings=utf-8
vimrc
最新推荐文章于 2024-04-16 22:24:44 发布