LoginSignup
56
52

More than 5 years have passed since last update.

Vim + Python 開発環境設定メモ

Last updated at Posted at 2014-09-16

Install パッケージ

Pythonのソースコードをキレイにメンテする時に役立つツール

$ sudo pip install flake8 pyflakes pep8 pylint jedi
$ sudo apt-get install vim-python-jedi

condaでやる場合

$ sudo conda install flake8 pyflakes pep8 pylint jedi

NeoBundleの準備

Vimのプラグインの管理ツール

mkdir -p ~/.vim/bundle
git clone https://github.com/Shougo/neobundle.vim ~/.vim/bundle/neobundle.vim

vimrc に、NeoBundle の設定を記述する

vi ~/.vimrc
" bundleのディレクトリ指定
set runtimepath+=~/.vim/bundle/neobundle.vim/
" neobundleを読み込む
call neobundle#begin(expand('~/.vim/bundle/'))
" neobundle を管理
NeoBundleFetch 'Shougo/neobundle.vim'

" **** 導入するプラグイン ****
NeoBundle 'Flake8-vim'
NeoBundle 'davidhalter/jedi-vim'
NeoBundle 'hynek/vim-python-pep8-indent'
NeoBundle 'Townk/vim-autoclose'
NeoBundle 'scrooloose/syntastic'

" neobundle を閉じる
call neobundle#end()

" インストールするか自動でチェック
NeoBundleCheck

PyFlakeの設定

"保存時に自動でチェック
let g:PyFlakeOnWrite = 1
let g:PyFlakeCheckers = 'pep8,mccabe,pyflakes'
let g:PyFlakeDefaultComplexity=10

syntasticの設定

let g:syntastic_python_checkers = ['pyflakes', 'pep8']

jediの確認

:h jedi

でヘルプが出たらOK

56
52
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
56
52