14

I have visited Vim website , script section and found several synthax checkers for python. But which one to choose ? I would prefer something that supports python 3 as well, even though I code in python 2.6 currently.

Do all these checkers need a module like pychecker and pyflakes ?

I could install the most popular from scripts database but I thought to get some recommendations here first from what you consider the best and why. The script will have to work MACOS, windows and ubuntu, with MACOS being my highest priority.

In case you are wondering I am looking for syntax checking like the one used by PyDev in Eclipse IDE which underlines with a red wavy line all erros as you type.

1
  • Also, if you like Vim and use Python a lot, you might find vimpdb useful sometimes. Here's a screenshot too. Commented Oct 14, 2010 at 2:20

5 Answers 5

7

I use the PyFlakes vim script, and I'm pretty satisfied with it. Also, if you'd like PEP8 checking, try this script.

Sign up to request clarification or add additional context in comments.

1 Comment

As of this note, "pyflakes-vim is officially deprecated!"
7

These two websites really boosted my Vim productivity with all languages:

http://nvie.com/posts/how-i-boosted-my-vim/

http://stevelosh.com/blog/2010/09/coming-home-to-vim/

1 Comment

This doesn't answer the question
6

I'm using Syntastic plugin. It's working great so far. I use it instead of just pyflakes (Syntastic uses Pyflakes) because when doing Python development, I develop for web, so I need to edit Javascript and well and having a validation on the fly for various languages is a plus.

2 Comments

I think Syntastic uses pylint.
@Jabba you can choose which syntax checker you can use, from pyflakes to pylint to flake8. Nowadays I'm using flake8.
3

This question was asked in 2010, but as of now, you have a simple solution.
After the release of Vim 8 in September 2016, which supports asynchronous I/O support, you can use Asynchronous Lint Engine.
It supports most major languages, and of course you have to install the linter yourself or it won't work.
Be aware that it conflicts with syntastic, so you'd better disable or remove it if you have it installed.

Comments

0

Whether or not wavy red lines are displayed is related to the theme you're using, not the syntax checker or language. So long as your syntax file (try http://www.vim.org/scripts/script.php?script_id=790 ) checks for errors, you can show the errors with something like:

:hi Error           guifg=#ff0000 gui=undercurl

3 Comments

the vim (7.3) i am using already has the python.vim inside the syntax folder( I have also downloaded and installed the python3.0.vim) , but still it does not display errors, tried your command again it does not display errors. My point was not whether the line is red , purple, wavy or straight , but wether I can see errors as I type underlined, highlighted or whatever way will attrack my attention. Is there any special command to enable syntax checking ? I am talking python syntax here, not vim syntax.
Ah sorry, I misunderstood. Your best bet is to combine the above highlighting command with something like pyflakes.vim and the pyflakes module. I'm not sure of another way.
Oh I see, than you very much friend for your reply, I will try to follow your advice.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.