如何在vim中突出显示ex模式输出的匹配文本,如:syntax命令做了什么?

如何在vim中突出显示ex模式输出的匹配文本,如:syntax命令做了什么?,vim,Vim,我不是说语法,突出显示普通模式文本。 我想做的是突出显示ex mode命令的输出文本,ex :g/re/p 命令将打印出与re匹配的行,但如何在屏幕上突出显示输出文本。我注意到 :syntax 命令在屏幕上输出带高亮显示的文本,这就是我想要的。只需设置hlsearch :set hlsearch 或者干脆 :set hls 来自:帮助hls 'hlsearch' 'hls' boolean (default off) global

我不是说语法,突出显示普通模式文本。 我想做的是突出显示ex mode命令的输出文本,ex

:g/re/p   
命令将打印出与re匹配的行,但如何在屏幕上突出显示输出文本。我注意到

:syntax

命令在屏幕上输出带高亮显示的文本,这就是我想要的。

只需设置
hlsearch

:set hlsearch
或者干脆

:set hls
来自
:帮助hls

'hlsearch' 'hls'    boolean (default off)  
                    global  
                    {not in Vi}  
                    {not available when compiled without the  
                    |+extra_search| feature}  
    When there is a previous search pattern, highlight all its matches.  
    The type of highlighting used can be set with the 'l' occasion in  
“突出显示”选项。这将使用“搜索”突出显示组by
违约请注意,只有匹配的文本突出显示,任何
抵消
未应用。

请尝试
:sil g/re
以防止打印匹配的文本。