I am referring to the grey background highlighting which is making vim unreadable. Note - I am running vim on Windows Subsystem for Linux. Also, this is not search highlighting. This is the default view every time I open Vim.
It seems it has nothing to do with syntax highlighting. I created a new file named a.txt . On using :syn list , it said no syntax items defined for this buffer, but I still had grey background on every line.
You can change color schemes at anytime in vi by typing colorscheme followed by a space and the name of the color scheme. For more color schemes, you can browse this library on the vim website. You can enable or disable colors by simply typing "syntax on" or "syntax off" in vi.
Press 1 to highlight the current visually selected text, or the current word (if nothing is selected). Highlight group hl1 is used. Press 2 for highlight hl2 , 3 for highlight hl3 , etc. Press 0 to remove all highlights from the current visually selected text, or the current word.
After opening login.sh file in vim editor, press ESC key and type ':syntax on' to enable syntax highlighting. The file will look like the following image if syntax highlighting is on. Press ESC key and type, “syntax off” to disable syntax highlighting.
Add the following to your . vimrc: :nnoremap <silent> <CR> :nohlsearch<CR><CR> . Hit return in command mode, and the highlighting disappears.
You need to find out which syntax group causes the highlighting. :syn list
shows all active groups, but it's easier when you install the SyntaxAttr.vim - Show syntax highlighting attributes of character under cursor plugin. When you have the name of the offending syntax group, you can investigate where it comes from; (the last lines of) :scriptnames
may help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With