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:清除所以标记;

示例如下:
使用不同的颜色标识不同的相同单词

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值