Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
Help us understand the problem. What is going on with this article?

Vim + Python 開発環境設定メモ

More than 1 year has passed since last update.

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

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away