开发者

What Vim script you recommend for checking Python syntax on the fly?

I have visited Vi开发者_JAVA百科m 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.


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


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/


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.


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.


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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜