Could you recommend, how to configure Vim to stick to :
PEP 8 -- Style Guide for Python Code
when editing python2/3 files, and only those (I'd like to leave configuration as it is for all other filetypes).
PEP 8, sometimes spelled PEP8 or PEP-8, is a document that provides guidelines and best practices on how to write Python code. It was written in 2001 by Guido van Rossum, Barry Warsaw, and Nick Coghlan. The primary focus of PEP 8 is to improve the readability and consistency of Python code.
Using Vim as a Python IDEThe python-mode project is a Vim plugin with syntax highlighting, breakpoints, PEP8 linting, code completion and many other features you'd expect from an integrated development environment.
PEP stands for Python Enhancement Proposal. A PEP is a design document providing information to the Python community, or describing a new feature for Python or its processes or environment.
Using ale plus installing a linter pip3 install pylint
is asynchronous and therefore probably the better idea. It does not block when you save, syntastic will block. It also works for other languages (like syntastic). It is based on the Language Server Protocol.
Using syntastic plus installing pip install flake8
gives you the best experience IMHO. syntastic
is great, because it not only does pep8 checks for Python, but by installing other software it's really easy to add syntax checks and the like for other languages.
vim-flake8
is the better choice, I will try it :-)
There's also a little script called 'pep8' - https://github.com/vim-scripts/pep8
I have it configured on 8:
let g:pep8_map='<leader>8'
I really like it. It works really good.
There's vim-flake8, which is most easily set up using vim-pathogen or Vundle.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With