I am new to vim and currently learning as well. I just started using syntastic in vim to lint my code.

I have set following vars in my .vimrc file:

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

If any error comes error window gets open, and show the list of errors. I just want to know is there any way to switch betweeb opened error window and current window.

Also is there any keystroke which I can use to move to next and prev error? (not by using :lnext and :lprev)

enter image description here


  • 1
    You could map something to lprev and lnext.
    – muru
    Commented Jun 5, 2016 at 21:20
  • will you please explain me how to to do that? I am quite new to it. Thanks
    – WitVault
    Commented Jun 5, 2016 at 21:23
  • 1
    You don't. Well, you can do it, but it's better to stay in the editor window. See the FAQ. Commented Jun 5, 2016 at 21:33

1 Answer 1


To switch between two windows see :h window-move-cursor. Here you'll use Ctrl-wj and Ctrl-wk, since the windows are horizontally split.

Now to use :lnext and :lprev more easily you could use a mapping as suggested by @muru. To do so add something like that to your .vimrc:

nnoremap <c-n> :lnext<CR>

This line will make Ctrl-n execute :lnext in normal mode. See :h mapping.

Of course change the mapped keys (here <c-n>) to whatever fits your needs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.