打造vim的python编辑器
                                                            生活随笔
收集整理的這篇文章主要介紹了
                                打造vim的python编辑器
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.                        
                                最好重新裝vim
$sudo apt-get remove vim-tiny $apt-get update $apt-get install vim $ vim --version如果不支持,則要裝
$ sudo apt install vim-nox-py2裝好后若支持會出現(xiàn)’+python’
 
安裝Vundle(類似python的pip)
git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim在根目錄下新建文件.vimrc
$ cd ~$ touch .vimrc三、下列代碼寫入 .vimrc 文件
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' "配色方案(終端模式) Plugin 'jnurmine/Zenburn' "配色方案(GUI模式) Plugin 'altercation/vim-colors-solarized' "超級搜索 Plugin 'kien/ctrlp.vim' "markdown插件 Plugin 'godlygeek/tabular' Plugin 'plasticboy/vim-markdown'" 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"\set foldmethod=indent\set foldlevel=99 " highlight the badwhitespace "au BufRead,BufNewfile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/"enable folding "set foldmethod=indent "縮進折疊 "set foldlevel=99set 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 python %"endif endfunc"instrall YouCompleteMe "cd "cd .vim/bundle/YouCompleteMe/ "./install.py --clang-completer Bundle 'Valloric/YouCompleteMe'"判斷運行模式,選擇配色方案 if has('gui_running')set background=darkcolorscheme solarized elsecolorscheme zenburn endif filetype plugin indent on " required四、保存退出,重新進入vim
~$ vim :PluginInstall出現(xiàn)’Procession xxx’字樣
 等待它裝完
 
 五、前面步驟裝了youcompleteme但是未編譯
總結(jié)
以上是生活随笔為你收集整理的打造vim的python编辑器的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
 
                            
                        - 上一篇: tensorflow对应的cudnn、c
- 下一篇: linux远程关闭不中断
