vim中所有行的第一列背景变成深蓝色,如何恢复正常?
ringa_lee
ringa_lee 2017-05-16 16:41:38
[PhpStudy讨论组]

配色设置为colorscheme desert

好像是执行了:4,11s/^/#/g这样一个命令后,就变成了下面图片的这个样子。

在正常、编辑两种模式下都存在这个问题。

如何才能恢复正常?

===============

根据weakish的回复,高亮是因为替换命令高亮所选择的内容造成的,所以使用set nohls就可以了。
不过let @/ =""这句话也有同样的效果,能解释一下这句话的含义吗?

ringa_lee
ringa_lee

ringa_lee

全部回复(6)
PHP中文网

这个是正常行为。因为你执行了: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 or , the
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

ringa_lee

:nohl

xxxxxxxxxxxxxxxxxxxxxxxxx

某草草

no high light search
:nohls

大家讲道理

:noh 回车
取消高亮显示查找到的结果.

为情所困

是我用的话,我就直接搜索一个随机的字符串就可以了。不用记得那么详细如:/sadjfldsjglkfdjgh 这样首行就不高亮了。

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号