The color scheme is set to colorscheme desert
It seems that after executing a command like: 4,11s/^/#/g, it will look like the picture below.
This problem exists in both normal and editing modes.
How can I get back to normal?
===============
According to weakish's reply, the highlighting is caused by the content selected by the replacement command highlighting, so just use set nohls.
However, let @/ ="" also has the same effect. Can you explain the meaning of this sentence?
This is normal behavior. Because you executed
:4,11s/^/#/g
, this operation is to match the beginning of the line, so all lines will be highlighted.Enter the following command to cancel highlighting.
If you never want to see highlighted search results, then delete the following line in
.vimrc
和.gvimrc
:let @{reg-name} = {expr1}:let-register:let-@
or
, the
Write the result of the expression {expr1} in register
{reg-name}. {reg-name} must be a single letter, and
must be the name of a writable register (see
|registers|). "@@" can be used for the unnamed
register, "@/" for the search pattern.
If the result of {expr1} ends in a
register will be linewise, otherwise it will be set to
characterwise.
This can be used to clear the last search pattern: >
:let @/ = ""
< This is different from searching for an empty string,
that would match everywhere.
这是vim的帮助文档,相信你能看懂吧:This can be used to clear the last search pattern
:nohl
xxxxxxxxxxxxxxxxxxxxxxxxx
no high light search
:nohls
:noh Enter
Unhighlight found results.
If I use it, I just search for a random string. There is no need to remember such details as: /sadjfldsjglkfdjgh so that the first line will not be highlighted.