VHDL comments in Vim?

P

Peter Sommerfeld

Hi folks,

I'm getting tired of commenting large blocks of VHDL code by hand.

Anyone know of any Vim scripts that can comment/un-comment a VHDL
block?

A cursory Google search brings up either nothing or way too much stuff
to sift through depending on my search terms ("vhdl vim comment").

-- Pete
 
A

Allan Herriman

Hi folks,

I'm getting tired of commenting large blocks of VHDL code by hand.

Anyone know of any Vim scripts that can comment/un-comment a VHDL
block?

A cursory Google search brings up either nothing or way too much stuff
to sift through depending on my search terms ("vhdl vim comment").

From Hamish Moffatt:

"Commenting lines. Visual select the block required and type ,c
vmap ,c :s/^/--/
vmap ,d :s/^--//

Here's the Verilog equivalent:

"Commenting lines. Visual select the block required and type ,c
vmap ,c :s/^/\/\//
vmap ,d :s/^\/\///

Hmmm. These lines had an escape after the last character, but that
won't appear in this post. You could probably substitute '<CR>'
(without the quotes) instead.
Add the lines to the appropriate file type plugin file.

Regards,
Allan.
 
H

Herwig Dietl

Peter said:
Hi folks,

I'm getting tired of commenting large blocks of VHDL code by hand.

Anyone know of any Vim scripts that can comment/un-comment a VHDL
block?

A cursory Google search brings up either nothing or way too much stuff
to sift through depending on my search terms ("vhdl vim comment").

-- Pete

Try Emacs if you can. It has a very comfortable VHDL electric mode.

If you write -- at the beginning of a line and then press Enter, the
next line will also be commented.
 
P

PO Laprise

If you write -- at the beginning of a line and then press Enter, the
next line will also be commented.

Not to start an emacs vs. vim war, but a properly set-up vhdl plug-in in
vim will do this as well.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top