Jump to next error / code highlighted in red

↘锁芯ラ 提交于 2019-11-30 03:07:39
Nguyen

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.

bryan

I think you were on the right track with :cnext.

:cnext and :cprevious are Vim QuickFix commands; you can take advantage of them by using a code validation plugin that uses QuickFix mode, like pyflakes.vim for Python, and jslint.vim/jshint.vim for JavaScript.

This will result in syntax errors being marked with squiggly red underlines, as opposed to the solid red syntax error highlighting I believe you are seeing. You should then be able to use :cnext and :cprevious to skip to the next and previous marked errors.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!