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
轉載于:https://www.cnblogs.com/bky-lxin/p/11607579.html
總結
- 上一篇: 格式化verilog/systemver
- 下一篇: JAVA中priorityqueue详解