1
votes

I am usinh emacs verilog-mode to build some verilog source code. 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.

Verilog mode has an emacs function that adds a comments to every end block showing which begin it is paired with. However, this does show for every begin and end block.

I was wondering what are the options when navigating verilog in emacs? 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).

Could someone help me out?

1

1 Answers

1
votes

Use M-x verilog-begin-of-defun and M-x verilog-end-of-defun

which you can bind to a key in your init file like:

(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.