我的vimrc-windows

发表评论63次阅读2009.09.11 0:08 作者:Felicia 编辑

[阅读更多]
下载: vimrc
source $VIMRUNTIME/mswin.vim
behave mswin
inoremap <C-D> <C-O>dd
map <F3> 0i//<C-C>
inoremap <F3> /**/<left><left>
map <F4> ^xx
inoremap <CR> <CR><left><right>
nnoremap <o> <o><left><right>
nnoremap <O> <O><left><right>
inoremap <c-]> {<cr>}<c-o>O<left><right>
noremap <F6> =a{
syn on
colo oceandeep
se ru nu
set ts=4
set sw=4
set cin
au FileType cpp,c se cin noswf
set expandtab
set smarttab
autocmd BufEnter * lcd %:p:h
set gfn=Courier\ New\ 10
set nowrap
set ww=<,>,[,]
set lines=40 columns=100
set go=
map <c-t> :tabnew<CR>
map <tab> :tabn<CR>
map <c-w> :close<cr>
map <F9> :call CR()<CR><space>
func CR()
exec "update"
exec "!start cmd /c g++ %<.cpp -Wall -o %< & pause & %< < %<.in & pause"
endfunc
map <F10> :call CR2()<CR><space>
func CR2()
exec "update"
exec "!start cmd /c g++ %<.cpp -Wall -o %<.exe & pause & %< & pause"
endfunc
map <F5> :call SetTitle()<CR>GkkkA
func SetTitle()
let l = 0
let l = l + 1 | call setline(l, "/**********************************************************************")
let l = l + 1 | call setline(l, "Author: Felicia")
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, "Description: ")
let l = l + 1 | call setline(l, "**********************************************************************/")
let l = l + 1 | call setline(l, "#include <cstdio>")
let l = l + 1 | call setline(l, "#include <cstring>")
let l = l + 1 | call setline(l, "#include <cstdlib>")
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, "")
let l = l + 1 | call setline(l, "using namespace std;")
let l = l + 1 | call setline(l, "")
let l = l + 1 | call setline(l, "typedef long long int64;")
let l = l + 1 | call setline(l, "const int maxint = 0x7FFFFFFF;")
let l = l + 1 | call setline(l, "const int64 maxint64 = 0x7FFFFFFFFFFFFFFFLL;")
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, "    return 0;")
let l = l + 1 | call setline(l, "}")
let l = l + 1 | call setline(l, "")
endfunc
autocmd BufWritePre,FileWritePre *.cpp   call LastMod()
fun LastMod()
    let L = line("$")
    let original_view = winsaveview()
    if L > 20
        let L = 20
    endif
    exe "1," . L . "g/Modified Time: /s/Modified Time: .*/Modified Time: " .
        \ strftime("%c")
    call winrestview(original_view)
endfun

set foldenable
set foldmethod=marker
"marker
noremap <space> @=((foldclosed(line('.')) < 0) ? 'zc' : 'zo')<CR>
"inoremap ( ()<left>
"inoremap ) <c-r>=ClosePair(')')<CR>
"inoremap { {}<left>
"inoremap } <c-r>=ClosePair('}')<CR>
"inoremap [ []<left>
"inoremap ] <c-r>=ClosePair(']')<CR>
function ClosePair(char)
if getline('.')[col('.') - 1] == a:char
return "\<Right>"
else
return a:char
endif
endf
map<F4> :call AddComment()<cr>
func AddComment()
    if (getline('.')[0] == '/')
        normal ^xx
    else
        normal 0i//
    endif
endfunc

au BufNewFile,BufRead *.fg setfile c
cd e:\workspace
标签, | 日志分类:心情日记

我的vimrc

5 评论34次阅读2008.05.22 12:10 作者:Felicia 编辑

[阅读更多]

最近改的vimrc,记录在这里备用
(全文 …)

标签, , | 日志分类:Linux