日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

打造vim的python编辑器

發(fā)布時間:2024/9/15 python 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 打造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但是未編譯

cd ~/.vim/bundle/YouCompleteMe git submodule update --init --recursive ./install.py --clang-complete

總結(jié)

以上是生活随笔為你收集整理的打造vim的python编辑器的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。