我的Vim配置(vimrc记录和改进学习使用)

"Bundle
set nocompatible
set backspace=indent,eol,start
"set fdm=indent
set hlsearch

syntax enable

filetype on
filetype off " Required

set rtp+=$HOME/.vim/bundle/vundle/
call vundle#rc()

" Use pathogen
"source ~/.vim/bundle/vim-pathogen/autoload/pathogen.vim
"call pathogen#runtime_append_all_bundles()

Bundle 'gmarik/vundle'
Bundle 'a.vim'
Bundle 'plasticboy/vim-markdown'
Bundle 'vim-autocomplete'
Bundle 'tagbar'
Bundle 'vim-powerline'
Bundle 'Colour-Sampler-Pack'
Bundle 'DoxygenToolkit'
Bundle 'nerdtree'
Bundle 'QFixToggle'
Bundle 'vim-headerGatesAdd'
Bundle 'OmniCppComplete'
Bundle 'snipmate'
Bundle 'vim-mru'
"Install syntastic
Bundle 'syntastic'

" Poweline
set laststatus=2
filetype on
let g:Powerline_symbols = 'utf-8'
"set t_Co=256
let g:solarized_termcolors=256
let g:Powerline_theme = 'default'
let g:Powerline_colorscheme = 'solarized256'
let g:Powerline_mode_n = 'NORMAL'

" HeaderGatesAdd
let g:DoxygenToolkit_authorName="wangchenxi"
let g:DoxygenToolkit_versionString="0.1.00"
let g:DoxygenToolkit_briefTag_funcName="yes"
autocmd BufNewFile *.{x,h,hpp,c,cc,pc,sqc,cpp} DoxAuthor
autocmd BufNewFile *.{h,hpp,c,pc,sqc,cpp,cc} exec 'call append(0, "\/\/ Last Update: " . strftime("%Y-%m-%d %H:%M:%S", localtime()))'
autocmd BufNewFile *.{py,sh} exec 'call append(0, "\# Last Update: " . strftime("%Y-%m-%d %H:%M:%S", localtime()))'
autocmd BufNewFile *.{py,sh} exec 'call append(0, "\# Create Time:" . strftime("%Y-%m-%d %H:%M:%S", localtime()))'
autocmd BufNewFile *.{py,sh} exec 'call append(0, "\# version: 0.1.00")'
autocmd BufNewFile *.{py,sh} exec 'call append(0, "\# brief: ")'
autocmd BufNewFile *.{py,sh} exec 'call append(0, "\# mail: [email protected]")'
autocmd BufNewFile *.{py,sh} exec 'call append(0, "\# author: wangchenxi")'
autocmd BufNewFile *.{py,sh} exec 'call append(0, "\# file: " . expand("%"))'
autocmd BufNewFile *.{py} exec 'call append(0, "\# -*- coding:gbk -*- ")'
autocmd BufNewFile *.{py} exec 'call append(0, "\#! C:\\Users\\uer\\AppData\\Local\\Programs\\Python\\Python36\\python.exe" )'
autocmd BufNewFile *.{sh} exec 'call append(0, "\#! C:\\Program Files\\OpenSSH\\bin2\\sh.exe" )'

"""""""""""""""""""""""""""""""""""""""""
""实现上面函数中的,Last modified功能
"""""""""""""""""""""""""""""""""""""""""
autocmd BufWrite,BufWritePre,FileWritePre  *.{c,sh,py,h,hpp,pc,cc,cpp,sql}    ks|call LastUpdate()|'s
func LastUpdate()
    if line("$") > 20
        let l = 20
    else 
        let l = line("$")
    endif
    exe "1,".l."g/Last Update: /s/Last Update: .*/Last Update:".
                \strftime(" %Y-%m-%d %X" ) . "/e"
endfunc

""""""""""""""""""""
" Color scheme
"colorscheme molokai
filetype plugin indent on

" Key Maps
set number
set smartindent
set cin
set ignorecase
" Userdefined indent style
set tabstop=4
set shiftwidth=4
set expandtab  "Uncomment when coding with Python
set list
set listchars=tab:\|\ ,nbsp:%,trail:-
set fileencodings=utf-8,gbk,ucs-bom,cp936,gb2312,gb18030
set incsearch
set tags=~/pbbusidayend/src/tags
"set backup
"set bdir=~/.file_backup

nnoremap <silent><F5> :NERDTreeToggle<CR>
nnoremap <silent><F6> :TagbarToggle<CR>
map <F12> ggvG=
vmap <C-c> "+y
vmap <C-x> "+d
vmap <C-/> :s/^/#/g <CR>
vmap <C-\> :s/^#//g <CR>
vmap <F11> dO#endif<Esc>O#if 0<Esc>o<Esc>p

猜你喜欢

转载自blog.csdn.net/Malloc_New/article/details/80544847
今日推荐