简体   繁体   English

使用emacs导航verilog开始和结束块以显示结构

[英]Navigating verilog begin and end blocks using emacs to show structure

I am usinh emacs verilog-mode to build some verilog source code. 我使用emacs verilog-mode构建一些verilog源代码。 However I observe that when the code becomes large(like in a case statement), I find it difficult to understand which begin is paired with which end block. 但是我观察到,当代码变大时(例如在case语句中),我很难理解哪个开始与哪个结束块配对。

Verilog mode has an emacs function that adds a comments to every end block showing which begin it is paired with. Verilog模式具有emacs功能,该功能为每个结束块添加注释,以显示与之配对的开始。 However, this does show for every begin and end block. 但是,这对于每个开始和结束块都显示。

I was wondering what are the options when navigating verilog in emacs? 我想知道在emacs中导航verilog时有哪些选项? Is there any function which will do code-folding given the delimiter used in the language(I should be able to specify begin,end are me delimiters instead of {} in C). 给定语言中使用的定界符,是否有任何函数可以进行代码折叠(我应该能够指定begin,end是我定界符,而不是C中的{})。

Could someone help me out? 有人可以帮我吗?

Use Mx verilog-begin-of-defun and Mx verilog-end-of-defun 使用Mx verilog-begin-of-defunMx verilog-end-of-defun

which you can bind to a key in your init file like: 您可以将其绑定到init文件中的键,例如:

(eval-after-load 'verilog-mode 
  '(define-key verilog-mode-map (kbd "C-{") 'verilog-beg-of-defun))

and: 和:

(eval-after-load 'verilog-mode 
  '(define-key verilog-mode-map (kbd "C-}") 'verilog-end-of-defun))

that will bind C-{ and C-} to beginning and end. C-{C-}绑定到开始和结束。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM