2

Is there a way to make Vim close Syntastic buffer when closing the main file?

I.e. I'd like Syntastic to run automatically on file opening, and "disappear" when I choose the main file with either ZZ or :q!.

With my default configuration Syntastic buffer remains (if there are unresolved warnings) and must be closed manually.

My .vimrc entries related to Syntastic:

set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*

let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
techraf
  • 227
  • 2
  • 9
  • let g:syntastic_check_on_wq = 0 – lcd047 Jul 14 '16 at 07:29
  • @lcd047 I have that option set to 0. – techraf Jul 14 '16 at 07:32
  • 1
    Then please open an issue at the issue tracker. Explain what you did, what did you expect to happen, and what happened instead. – lcd047 Jul 14 '16 at 07:35
  • @lcd047 I will, but for the record: I added Syntastic to Pathogen, added the suggested config (ref. question body), opened a bash script with warnings from Shellcheck, closed it and the "check on quit" occurred (repeatable). – techraf Jul 14 '16 at 07:42
  • I can't reproduce the problem with the current master HEAD. Which is why it's probably a good idea to move this to a place that allows longer exchanges. – lcd047 Jul 14 '16 at 08:12
  • I never used syntastic but to deal with the quickfix window (which also stays open when you close the buffer) I have a mapping: nnoremap ZZ :xall<cr>. – grochmal Jul 14 '16 at 13:36

0 Answers0