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:清除所以標記;

示例如下:
使用不同的顏色標識不同的相同單詞
在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章