配色设置为colorscheme desert
好像是执行了:4,11s/^/#/g这样一个命令后,就变成了下面图片的这个样子。
在正常、编辑两种模式下都存在这个问题。
如何才能恢复正常?
===============
根据weakish的回复,高亮是因为替换命令高亮所选择的内容造成的,所以使用set nohls就可以了。
不过let @/ =""这句话也有同样的效果,能解释一下这句话的含义吗?
这个是正常行为。因为你执行了:4,11s/^/#/g
,这个操作是匹配行首,所以所有行首都会高亮。
输入以下命令取消高亮。
:let @/ = ""
如果你永远不想看到高亮搜索结果,那么在.vimrc
和.gvimrc
中删掉以下这行
set hls
:let @{reg-name} = {expr1} :let-register :let-@
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
是我用的话,我就直接搜索一个随机的字符串就可以了。不用记得那么详细如:/sadjfldsjglkfdjgh 这样首行就不高亮了。
:nohl
xxxxxxxxxxxxxxxxxxxxxxxxx
no high light search
:nohls
:noh 回车
取消高亮显示查找到的结果.