When dealing with merge conflicts it is common that the >>>>>>
and ======
inserted by DCVS are syntactically incorrect for the file I'm in and show up as highlighted in red. When dealing with merge conflicts it would be useful to have commands to jump to these error. When I type :cnext
I just get the message "No Errors". These are Mercurial merge conflicts so I can't use Fugitive, but I generally prefer editing merge conflicts by hand anyway.
Is there a way to jump to the next syntax error in the file? I think these errors are dictated by the syntax highlighting file.
You can use :lopen
to open window containing error/warning lines. After that, navigate to each of them.
The actual answer is that you can use :lnext
to jump to the next error, or :lprev
, or ]l and [l (those are lowercase Ls) if you have vim-unimpaired, which you do, because you shouldn't use Vim without it.
This will not actually jump to the next red/error highlighted text group, but will jump to whatever your syntax plugin dictates is an error (and populates the location list). It is impossible in Vim to jump to a specific highlighting group, because no one has bothered to figure out how yet.
The plugin SRDispHiGrp comes close, but if you couldn't tell from the name, is too convulted and confusing for human use.