Error location navigation in Vim Syntastic

:lne[xt] and :lp[revious] are the correct shortcuts.

But :lN[ext] is not the same as :lne[xt]: it's an alternative to :lp[revious].

The message you get is due to the fact that these command don't wrap around when you reach the last or the first error.

The commands you listed in your question both jump to the previous error but chances are you are already on the first error and there's nothing before. use the right commands, keep in mind that they don't wrap around and you'll be good.

Read :h location-list for a complete list of commands.


If there's only one issue in the list, :ll will navigate to it.

Here's a fix for your .vimrc that will make keys mapped to :lnext and :lprev work correctly in the case of only one issue (by jumping to it). Change the nmappings at the end to your preferred key sequence.

(from https://github.com/scrooloose/syntastic/issues/32 )

" Fix syntastic error jumping
function! <SID>LocationPrevious()
  try
    lprev
  catch /^Vim\%((\a\+)\)\=:E553/
    llast
  endtry
endfunction

function! <SID>LocationNext()
  try
    lnext
  catch /^Vim\%((\a\+)\)\=:E553/
    lfirst
  endtry
endfunction

nnoremap <silent> <Plug>LocationPrevious    :<C-u>exe 'call <SID>LocationPrevious()'<CR>
nnoremap <silent> <Plug>LocationNext        :<C-u>exe 'call <SID>LocationNext()'<CR>
nmap <silent> e[  <Plug>LocationPrevious
nmap <silent> e]  <Plug>LocationNext

Since :lnext etc. are tedious to type (you usually want to iterate quickly over them, the unimpaired.vim - Pairs of handy bracket mappings plugin provides (among others) short ]l mappings.

Tags:

Vi

Vim