打造vim的python3编辑器

set nocompatible              " required
filetype off                  " required

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'

" Add all your plugins here (note older versions of Vundle used Bundle instead of Plugin)
"install flake8 to check errors
Plugin 'scrooloose/syntastic'
Plugin 'nvie/vim-flake8'
"document-tree
Plugin 'scrooloose/nerdtree'
"Powerline
Plugin 'Lokaltog/vim-powerline'
"指示线
Plugin 'Yggdroot/indentLine'
"自动补全括号和引号等
Plugin 'jiangmiao/auto-pairs'

" indentpython.vim
"
"
" All of your Plugins must be added before the following line
call vundle#end()            " required

"split navigations
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
nnoremap gl :YcmCompleter GoToDeclaration<CR>
nnoremap gf :YcmCompleter GoToDefinition<CR>
nnoremap gg :YcmCompleter GoToDefinitionElseDeclaration<CR>
let g:ycm_autoclose_preview_window_after_completion=1 "Completer's window wont close
let python_highlight_all=1
syntax on

"powerline
set guifont=PowerlineSymbols\ for\ Powerline
set nocompatible
set t_Co=256
let g:Powerline_symbols = 'fancy'

"hide *.pyc files
let NERDTreeIgnore=['\.pyc$', '\~$'] "ignore files in NERDTree

"enable pep8 indentation
au BufNewfile,BufRead *.py
			\set tabstop=4
			\set softtabstop=4
			\set shiftwidth=4
			\set textwidth=79
			\set expandtab
			\set autoindent
			\set fileformat=unix
			\set encoding=utf-8"
" highlight the badwhitespace
"au BufRead,BufNewfile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/


"enable folding 
set foldmethod=indent "缩进折叠
set foldlevel=99

set nu "显示行号
"enable folding with spacebar
nnoremap <space> za

"hotkey of nerdtree
map <C-n> :NERDTreeToggle<CR>

"按F5键运行python代码
map <F5> :call RunPython()<CR>
func! RunPython()
    exec "W"
    if &filetype == 'python'
	exec "!time python3 %"
    endif
endfunc

"instrall YouCompleteMe 
"cd 
"cd .vim/bundle/YouCompleteMe/
"./install.py --clang-completer
Bundle 'Valloric/YouCompleteMe'


filetype plugin indent on    " required

猜你喜欢

转载自blog.csdn.net/anny0001/article/details/84225138