In a c code, where code blocks are delimited by {..}, I can use "%" to move to the end of the block.

But in other languages (eg system-verilog), which uses features like:

class a;
   ...
   if(x)
     ....
   endif
endclass: a // here the ":a" is optional

how can I move from the first line of a block to its matching end line?

有帮助吗?

解决方案

Assuming you use Vim, there is an extension called matchit.vim in macros directory in the Vim folder, or you can download latest version of it at vim.org. You can configure it yourself if it doesn't support your choice of language out-of-the-box.

Link to the plugin: http://www.vim.org/scripts/script.php?script_id=39

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top