Question

I have some autogenerated python files that are extremely large (long mathematical equations). Vim slows to a crawl when I open them for editing because I have pyflakes-vim installed. I'd like to be able to disable pyflakes-vim only when I open these long files. Is there a simple way to do this, either before opening the file or even after? I do not want to turn off pyflakes-vim for all python files, just a case-by-case basis.

Was it helpful?

Solution 2

I've found another solution which is handy: https://github.com/kevinw/pyflakes-vim/pull/47

This fork of pyflakes-vim, which has not been merged in yet, allows you to toggle pyflakes on or off.

OTHER TIPS

PyFlakes won't run if b:did_pyflakes_plugin is defined when the plugin is loaded, but once it's loaded I don't think there's an easy way to disable it.

What I would do is give the auto-generated files a specific file name pattern (say *_auto.py) and then add to my .vimrc: autocmd BufReadPre *_auto.py :let b:did_pyflakes_plugin=1.

Take a look at flake8 - either as part of Syntastic or just vim-flake8 - then you can add # noqa at the end of a line to disable checking for that line. Also see this related question.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top