VHDL comments in Vim?

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

Reply to
Peter Sommerfeld
Loading thread data ...

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 '' (without the quotes) instead. Add the lines to the appropriate file type plugin file.

Regards, Allan.

Reply to
Allan Herriman

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.

--
Dietl Herwig

I am Murphy of Borg: Anything that can be assimilated will be.
Reply to
Herwig Dietl

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

--
Pierre-Olivier

-- to email me directly, remove all _N0SP4M_ from my address --
Reply to
PO Laprise

Don't , emacs people won't like :-p

--
Jos De Laender
Reply to
Jos De Laender

With VIM one can easily invoke a script from within vim on entire text (:%!perl my_scr.pl or :'a,'b!perl ...). In my site give many useful scripts and how to use them.

formatting link

You find this interesting: "Run a perl script from vim on a block of text, to enumerate constants for a state machine..."

formatting link

--------------------------------------- Posted through

formatting link

Reply to
pini_kr

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.