问题
I want to use pep8 as my makeprg in order to check and fix my code compliance to PEP8 (Style guide for python code).
I used the command :set makeprg=pep8\ --repeat\ %
, and when I do :make
it works, the error list is populated and I can use :cn
, :cp
and :copen
to navigate and see the error list in the QuickFix window.
But as soon as I change something in my python source file the errorlist becomes empty, the QuickFix window loses its content and I cannot navigate the list anymore.
I suspect that this is caused by PyFlakes, a Vim extension that highlights Python errors on-the-fly.
How can I fix it?
回答1:
pyflakes has an option that should solve your problem, just put this in your ~/.vimrc :
let g:pyflakes_use_quickfix = 0
This actually stops pyflakes from using (and breaking) the quickfix window, that is good enough for me.
回答2:
See this vim extension
来源:https://stackoverflow.com/questions/4814534/how-to-make-vim-error-list-permanent-using-pyflakes