Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to use pylint in vim
    primarykey
    data
    text
    <p>I do not want to install another plugin, like pylint.vim,</p> <p>And today, I decide to use vim edit python instead of pydev which is a eclipse plugin. But I got issues.</p> <p>I have add this in my vimrc</p> <pre><code>autocmd BufWritePost *.py !pylint &lt;afile&gt; </code></pre> <p>but pylint does not contains filename in output</p> <pre><code>************* Module mymodule E: 22: invalid syntax shell return 2 </code></pre> <p>so it can not jump to the line 22 , so I use sed change the output</p> <pre><code>autocmd BufWritePost *.py !pylint &lt;afile&gt; | sed 's/^\(\w*\):\s*\([0-9]\+\)/&lt;afile&gt;:\2: \1: /g' </code></pre> <p>it returns:</p> <pre><code>mymodule.py:22: E: : invalid syntax </code></pre> <p>but without shell return 2 by vim. so it still can't jump to that line. vim consider it as compile successfully</p> <p>========================= new comment =========== <a href="https://stackoverflow.com/questions/1766336/call-a-function-in-vims-autocmd-command">Call a function in Vim’s `autocmd` command</a></p> <p>I think maybe I should use make command and set makeprg, so I use below config</p> <pre><code>autocmd FileType python let &amp;makeprg='pylint &lt;afile&gt; | sed s/^\(\w*\):\s*\([0-9]\+\)/&lt;afile&gt;:\2: \1: /g' autocmd BufWritePost *.py make </code></pre> <p>when I save, vim returns:</p> <pre><code>************* Module count E: 3: invalid syntax (1 of 2): ************* Module count Error detected while processing BufWritePost Auto commands for "*.py": E492: Not an editor command: sed s/^\(\w*\):\s*\([0-9]\+\)/&lt;afile&gt;:\2: \1: /g </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload