admin管理员组文章数量:1122846
How can I in Vim highlight, e.g., the first 10 words in a line ?
I have found in Stackoverflow the answer for the first word :
/^\s*\w\+/
but I cannot figure how to tinker it for 10 words, or any number of words, by the way.
How can I in Vim highlight, e.g., the first 10 words in a line ?
I have found in Stackoverflow the answer for the first word :
/^\s*\w\+/
but I cannot figure how to tinker it for 10 words, or any number of words, by the way.
Share Improve this question edited Nov 22, 2024 at 16:13 romainl 196k21 gold badges297 silver badges333 bronze badges asked Nov 22, 2024 at 15:26 ThGThG 2,4014 gold badges23 silver badges35 bronze badges 4 |1 Answer
Reset to default 1Does this help?
/\v^\s*(<\w+>\s*){,5}
In the screenshot, it "highlights" 0-5 words as an example.
本文标签: highlightVim words syntax highlightingStack Overflow
版权声明:本文标题:highlight - Vim words syntax highlighting - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736302742a1931644.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
:help user-manual
) and refer to the relevant section of the documentation when you need to dig deeper (:help \+
and scroll around). – romainl Commented Nov 22, 2024 at 16:16