Here are three VIM plug-ins, one is Pyflakes, the other is PEP8, and their fit Flake8 installed
Installation is simple, find your. Vim directory, unzip the two compressed packets and put them in.
Go below vim official down down.
Pyflakes http://www.vim.org/scripts/script.php?script_id=2441
PEP8 http://www.vim.org/scripts/script.php?script_id=2914
Flake8 http://www.vim.org/scripts/script.php?script_id=4440
and put it in ~/.vim/ftplugin/python.
Note that the user's. Vim directory is placed. So if you're using the root account, you need to put a copy in the/root/.vim. Additionally PEP8 need to install PEP8 for Python
#pip install-u PEP8 Configuration
Flakes added to VIMRC inside.
if has("gui_running")
highlight SpellBad term=underline gui=undercurl guisp=Orange
endif
let g:pyflakes_use_quickfix = 1 "这是开关
PEP8 can set which key to detect, default F5
"let g:pep8_map=‘whatever key‘
Flake8
"Auto-check file for errors on write:
let g:PyFlakeOnWrite = 1
"List of checkers used:
let g:PyFlakeCheckers = ‘pep8,mccabe,pyflakes‘
"Default maximum complexity for mccabe:
let g:PyFlakeDefaultComplexity=10
"List of disabled pep8 warnings and errors:
let g:PyFlakeDisabledMessages = ‘E501‘
"Default height of quickfix window:
let g:PyFlakeCWindow = 6
"Whether to place signs or not:
let g:PyFlakeSigns = 1
"Maximum line length for PyFlakeAuto command
let g:PyFlakeMaxLineLength = 100
"Visual-mode key command for PyFlakeAuto
let g:PyFlakeRangeCommand = ‘Q‘
Use
Flakes will be prompted directly on the code editing page, with a malformed monogram red
The PEP8 is a hint in the Output window of vim
And Flake8 can prompt the line and error message directly at the time of saving
Quick fix Pyflakeauto feature for Flake8
We can bind it to the FX button.
Add the following map to the VIMRC to fix the PEP8 error directly by F6
map <F6> :PyFlakeAuto<CR>
There are Pychecker, Pylint and other testing, it is not listed.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Vim's Python Code detection Tool