~/.vimrc

来源:互联网 发布:java系统日工具 编辑:程序博客网 时间:2024/06/03 06:53
set rulerset hlsearchset nohlsearchset background=dark" set background=darkset tabstop=8set softtabstop=4set shiftwidth=4set softtabstop=2set softtabstop=8set shiftwidth=2set shiftwidth=8set encoding=utf-8" set cindent" set autoindent" set textwidth=80" set smartindentsyntax offsyntax onset winwidth=80" set ignorecaseset nowrapset wrapset autowritemap <C-J> :previous<CR>map <C-K> :next<CR>map <F2> :set number!<CR>map <F3> :call CComment2()<CR>map <F4> :call SComment()<CR>map <F7> :!make<CR>:!make run<CR>imap <F7> <ESC>:!make<CR>:!make run<CR>map <F8> :!make<CR>imap <F8> <ESC>:w<ESC>:!make<CR>map <F9> :w<CR>:!make run<CR>map <F10> :syntax on<CR>map <F11> :syntax off<CR>map <F12> :set hlsearch!<CR>function CComment()        let line = getline(".")        if line[0][0] == "/"                :s/\/\/ //        else                :s/^/\/\/ /        endifendfuncfunction CComment2()        let line = getline(".")        if line[0][0] == "/"                :s/\/\* //                :s/ \*\///        else                :s/^/\/\* /                :s/$/ \*\//        endifendfuncfunction SComment()        let line = getline(".")        if line[0][0] == "#"                :s/^# //        else                :s/^/# /        endifendfunc