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