http://blog.csdn.net/g_brightboy/article/details/14229139
#tips:(ycm没有生效)肯是自带的jedi-vim,备注以后研究
xdebug和DBGPavim没有生效。
" An example for a vimrc file.
" author holen
" data 2016-6
" Use Vim settings, rather than Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
" allow backspacing over everything in insert mode
set backspace=indent,eol,start
set history=50 " keep 50 lines of command line history
set ruler " show the cursor position all the time
set showcmd " display incomplete commands
set incsearch " do incremental searching
" In many terminal emulators the mouse works just fine, thus enable it.
set mouse=a
" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running")
syntax on
set hlsearch
set incsearch
endif
" folder code setting
set foldmethod=indent
au BufWinLeave * silent mkview
au BufRead * silent loadview
nnoremap <space> za
" detection filetype
filetype off
" loading filetype plugin
"filetype plugin on
" load indent files, to automatically do language-dependent indenting.
" filetype indent on
" python utomatic insufficiency
":inoremap ( ()<ESC>i
":inoremap ) <c-r>=ClosePair(')')<CR>
":inoremap { {}<ESC>i
":inoremap } <c-r>=ClosePair('}')<CR>
":inoremap [ []<ESC>i
"":inoremap ] <c-r>=ClosePair(']')<CR>
"":inoremap " ""<ESC>i
"":inoremap ' ''<ESC>i
function! ClosePair(char)
if getline(".")[col('.')-1] == a:char
return "\<Right>"
else
return a:char
endif
endfunction
" auto add file header
autocmd BufNewFile *.py 0r ~/.vim/.vim_head_template/vim_python
autocmd BufNewFile *.py ks|call FileName()|'s
autocmd BufNewFile *.py ks|call CreatedTime()|'s
autocmd BufNewFile * normal G
fun FileName()
if line("$") > 10
let l = 10
else
let l = line("$")
endif
exe "1,".l."g/File Name:.*/s/File Name:.*/File Name: ".expand("%")
endfun
fun CreatedTime()
if line("$") > 10
let l = 10
else
let l = line("$")
endif
exe "1,".l."g/Created Time:.*/s/Created Time:.*/Created Time: ".strftime("%Y-%m-%d %T")
endfun
" other general settings
set nu
winpos 225 225
set lines=35 columns=115
colo peachpuff
set autoindent
" set guifont=Lucida_Console:h12
set tabstop=4
set shiftwidth=4
set autoindent
set showmatch
set autowrite
set magic
set confirm
set history=500
set noswapfile
set whichwrap+=<,>,h,l
set clipboard+=unnamed
set pastetoggle +=<F9>
set noautoindent
set nosmartindent
set nocindent
"allow folder
set foldenable
set foldmethod=manual
" set encode
set encoding=utf-8
set fileencoding=utf-8
set fileencodings=ucs-bom,utf-8,GB18030,cp936,big5,euc-jp,euc-kr,latin1"
" moved window mapping
nmap <C-H> <C-W>h
nmap <C-J> <C-W>j
nmap <C-K> <C-W>k
nmap <C-L> <C-W>l
" Keyboard mapping
" None
" vundle Plug-in settings
" filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle, required
" original repos on github(On Github repository site non-vim-scripts plugins)
" Bundle 'tpope/vim-fugitive'
" vim-scripts repos(vim-scripts plugins)
" Bundle 'FuzzyFinder'
" other
" Bundle 'git://git.wincent.com/command-t.git'
" folder views
Bundle 'scrooloose/nerdtree.git'
" html and css
Bundle 'mattn/emmet-vim.git'
" code completion
Bundle 'Valloric/YouCompleteMe'
" right tagbar
Bundle 'majutsushi/tagbar'
" Folder code
Bundle 'tmhedberg/SimpylFold'
" Programming symbol completion
Bundle 'Raimondi/delimitMate'
" comment and cancel comment
Bundle 'scrooloose/nerdcommenter'
" like sourceInsight
"Bundle 'wesleyche/SrcExpl'
" xdebug
Bundle 'xdebug/xdebug'
" script language debug
Bundle 'brookhong/DBGPavim'
"YouComplete use jedi to Completion python
"Bundle 'davidhalter/jedi-vim'
filetype plugin indent on
let NERDTreeWinPos='left'
let NERDTreeWinSize=23
"let g:NERDTreeDirArrowExpandable = '▸'
"let g:NERDTreeDirArrowCollapsible = '▾'
"mapping open or close nerdteree
map <silent> <F2> :NERDTreeToggle<CR>
" mapping tagbarToggle
let g:tagbar_width = 25
map <silent> <F3> :TagbarToggle<CR>
" mapping SrcExplToggle
"map <silent> <F4> :SrcExplToggle<CR>
" Brief help
" :BundleList - list configured plugins " :PluginInstall(!)
" :BundleSearch(!) foo - search(or refresh cache first) for foo
" :BundleInstall (update) plugins
" :BundleClean(!) - confirm (or auto-approve) removal of unused
" hide .pyc
let NERDTreeIgnore=['\.pyc$', '\~$'] "ignore files in NERDTree
" setting cscope
" cs find c|d|e|g|f|i|s|t name
" using cscope to find word where is define,models as below:
" find where statement
nmap <C-@>s :cs find s <C-R>=expand("<cword>")<CR><CR>
" find where definition
nmap <C-@>g :cs find g <C-R>=expand("<cword>")<CR><CR>
" find current function calling that function
nmap <C-@>d :cs find d <C-R>=expand("<cword>")<CR><CR>
" find function that who was calling cur function
nmap <C-@>c :cs find c <C-R>=expand("<cword>")<CR><CR>
" find current string
nmap <C-@>t :cs find t <C-R>=expand("<cword>")<CR><CR>
" egrep models
nmap <C-@>e :cs find e <C-R>=expand("<cword>")<CR><CR>
" find current file
nmap <C-@>f :cs find f <C-R>=expand("<cword>")<CR><CR>
"find that file who contain current file
nmap <C-@>i :cs find i <C-R>=expand("<cword>")<CR><CR>
" set debugger
let g:dbgPavimPort = 9000
let g:dbgPavimBreakAtEntry = 0
" Ycm
let mapleader = ","
let g:mapleader = ","
autocmd FileType python set omnifunc=pythoncomplete#Complete
autocmd FileType python setlocal completeopt-=preview
autocmd FileType javascrīpt set omnifunc=javascriptcomplete#CompleteJS
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
autocmd FileType c set omnifunc=ccomplete#Complete
colorscheme desert