matchit匹配

1. Function: This addon allows using % to jump between matching keywords as Vim already does for matching parentheses/brackets. Many syntax files include the definition of the matching keyword pairs for their supported languages.

          功能是: 通过 % 匹配code的语法组合起始位置,便于快速查看/review 代码;  like  systemverilog的 begin/end, function/endfunction         

 2.  plugin source code :  https://www.vim.org/scripts/script.php?script_id=39

 

  3.install

    - download插件后解压将matchit.vim copy到.vim/plugin下

    - 在.vim/ftplugin/  对应的filetype下面define好 b:match_wrods : 插件matchit会根据这个去match

 4. use

    打开systemverilog的文件, 将光标落在function,然后按:%, 光标就自动跳转到 endfuntion上

 ---以上是以systemverilog为例的,如果想要在其他语言上使用的话,在.vim下对应的文夹下定义好自己的脚本;

当然可以search下vim官网或者github是否有对应的语言版本插件,插件一般都会带有这些定义;

 

 5. more 

下面github版本还未尝试:

https://github.com/vimtaku/hl_matchit.vim

posted @ 2019-09-29 14:09  freeic  阅读(789)  评论(0编辑  收藏  举报