Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to limit size of Vim Syntastic location list window

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?

like image 538
Shane Voisard Avatar asked May 17 '17 17:05

Shane Voisard


1 Answers

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
like image 101
Shane Voisard Avatar answered Sep 27 '22 21:09

Shane Voisard