2

How can I set automatically close pylint window after python code window is close in VIM?

Every time I quit from vim, but pylint window still displayed.

I want to automatically close pylint warning window when I quit from python code.

I know the way to doing this by manually is :qa!

Ingo Karkat
  • 167,457
  • 16
  • 250
  • 324
Ertuğrul Altınboğa
  • 2,187
  • 4
  • 17
  • 25

1 Answers1

3

Assuming the pylint window shows a scratch buffer, you can close this automatically via an :autocmd:

:autocmd WinEnter * if winnr('$') == 1 && ! empty(&buftype) && ! &modified | quit | endif

When you :quit, you either exit Vim or enter another open window. Above checks that this is a single window containing a scratch buffer with unpersisted changes, and then quits that, too. This should give you the general idea; you can tweak the conditions to better suit your needs.

Ingo Karkat
  • 167,457
  • 16
  • 250
  • 324
  • Handy link for those not familiar with autocmd: http://vimdoc.sourceforge.net/htmldoc/autocmd.html – kiminoa Mar 17 '15 at 17:51