Vi and Vim Asked by Sparhawk on August 31, 2021
I’ve just discovered how to make the cursor a vertical line in insert mode. This works well with cursorline; even with the thinner cursor, I can still easily find my position.
autocmd InsertEnter * set cul
autocmd InsertLeave * set nocul
However, the default underline makes it hard to see literal underscore characters _
.
CursorLine
, which would make underscores visible again, but this breaks syntax highlighting.syn match underscore "_"
autocmd InsertEnter * hi underscore ctermbg=grey cterm=none ctermfg=black
autocmd InsertLeave * hi clear underscore
I also know that I can change the cursorline to bold, italics, etc., but this is also visual overkill.
An ideal solution would be to make the cursorline underline be a light colour, with the literal underscore a darker black, but it seems that cursorline always inherits ctermfg
.
Is there a simple way to still see underscores, while using cursorline?
I’m using regular terminal vim (in Terminator generally), not gvim.
I actually went with coloring the background of the line number. This way you're not interfering with syntax colors or underscores.
So basically I have this (for light background terminal)
highlight CursorLineNr ctermfg=white guifg=white ctermbg=darkgrey guibg=darkgrey cterm=bold gui=bold
Answered by xicod on August 31, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP