How to limit size of Vim Syntastic location list window
Asked Answered
S

1

8

Vim syntastic plugin pops up the errors and warnings location list and it needlessly consumes more screen space than needed for the list:

enter image description here

How can I configure syntastic to open a location list window that has only enough lines to show the list?

Saxony answered 17/5, 2017 at 17:8 Comment(1)
This is answered in the manual: :h 'syntastic_loc_list_height', :h syntastic-loclist-callback.Larisalarissa
S
13

Thank you lcd047 for pointing out the answer. I added the following to my vimrc and it worked:

" see :h syntastic-loclist-callback
function! SyntasticCheckHook(errors)
    if !empty(a:errors)
        let g:syntastic_loc_list_height = min([len(a:errors), 10])
    endif
endfunction
Saxony answered 17/5, 2017 at 17:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.