简体   繁体   English

更改Vim命令以在MS-Windows中工作? 使用make检查python语法

[英]Change Vim command to work in MS-Windows? Use make to check python syntax

:make provides a list of errors which can be navigated through in order to fix. :make提供了可以修复的错误列表。

The problem is that this script only works in Unix based OSes. 问题在于该脚本仅在基于Unix的操作系统中有效。

autocmd BufRead *.py set makeprg=python\ -c\ \"import\ py_compile,sys;\ sys.stderr=sys.stdout;\ py_compile.compile(r'%')\"
autocmd BufRead *.py set efm=%C\ %.%#,%A\ \ File\ \"%f\"\\,\ line\ %l%.%#,%Z%[%^\ ]%\\@=%m

Anyone could help me make it work or provide the equivalent for Windows XP? 任何人都可以帮助我使其工作或提供Windows XP的等效软件吗?

For the first part to work, you must first add python to your PATH variable. 为了使第一部分起作用,必须首先将python添加到PATH变量中。

http://vlaurie.com/computers2/Articles/environment.htm http://vlaurie.com/computers2/Articles/environment.htm

python.exe should be placed in: python.exe应该放在:

c:\PythonXX\bin

But I'm not that sure, check it out before adding that one. 但我不确定,请在添加之前先检查一下。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM