VIM高亮显示选中单词

在VIM中高亮选中的单词,需要用到mark.vim插件,下载链接如下:

https://www.vim.org/scripts/script.php?script_id=1238

在这里插入图片描述
下载得到mark.vim文件,拷贝到~/.vim/plugin
在这里插入图片描述
该插件用法如下:

Usage:

Highlighting:
  Normal mode:
    \m mark/unmark the word under (or before) the cursor
          Place the cursor under the word to be highlighted, press \m, then the word will be colored.
    \r manually input a regular expression
          To highlight an arbitrary regular expression, press \r and input the regexp.
    \n clear this mark (i.e. the mark under the cursor), or mute/unmute all highlighted marks
          To clear all marks (instead of mute them), please use \m in muted state.
  Visual mode:
    \m mark/unmark a visual selection
          Select some text in Visual mode, press \m, then the selection will be colored.
    \r manually input a regular expression (base on the selection text)
  Command line:
    :Mark regexp   to mark a regular expression
    :Mark regexp   with exactly the same regexp to unmark it
    :Mark          to mute all marks
\m:标记/取消标记光标所在单词;
\r:手动输入正则表达式;
\n:清除所以标记;

示例如下:
使用不同的颜色标识不同的相同单词
在这里插入图片描述

发布了17 篇原创文章 · 获赞 11 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/u010561799/article/details/105405999