如何在我 "gd" 一个词后取消 vim 突出显示?
How to cancel vim highlight after I "gd" on a word?
我在一个词上使用 "gd" 来突出它的所有实例,很好。然后我希望这些亮点应该消失,因为我不想被打扰。任何 vim 命令取消突出显示最后的结果?
使用 nohlsearch
命令,或其简短版本 nohls
。
您可以使用函数clearmatches
或命令noh
清除所有高亮。
:noh
:call clearmatches()
我已经在 .vimrc
中重新映射了它
noremap <leader>g :noh<cr>:call clearmatches()<cr>
来自:h noh
Stop the highlighting for the 'hlsearch' option. It
is automatically turned back on when using a search
command, or setting the 'hlsearch' option.
我在一个词上使用 "gd" 来突出它的所有实例,很好。然后我希望这些亮点应该消失,因为我不想被打扰。任何 vim 命令取消突出显示最后的结果?
使用 nohlsearch
命令,或其简短版本 nohls
。
您可以使用函数clearmatches
或命令noh
清除所有高亮。
:noh
:call clearmatches()
我已经在 .vimrc
noremap <leader>g :noh<cr>:call clearmatches()<cr>
来自:h noh
Stop the highlighting for the 'hlsearch' option. It
is automatically turned back on when using a search
command, or setting the 'hlsearch' option.