On Mon, Jul 02, 2001 at 09:33:34AM +0100, Rory Winston wrote:
> what I'd like to be able to do is to place the cursor on a line containing a subprocedure, hit a key, and Vim to generate an automatically formatted comment block, e.g. for
> # Name : foo
> # Author : blah
> # Last Modified: whenever
> Whenever I hit a certain key. I'm not really sure how to do this though,
Well, I dont exactly come into the class of people described in the
subject, but you might want to take a look at http://www.vim.org/why.html
.
From the above webpage:
Macro (Map) Recording
Vi users who write "mappings" to abbreviate a series of
commands know how tedious it can be to remember the keystrokes
for this. Vim makes it easy with "macro recording": The letter
'q' (which is unused in Vi, btw) is used to start the
recording; the next letter is the name of a register which is
to store the keystrokes. Whatever you type after that is stored
within the register until you type another 'q'. That's it. You
can then play back this sequence with the command '@' followed
by the register letter/name.
Example:
qa Start recording into register 'a'
G jump to last line of current buffer
?^-- $^M search backward for a line with sigdashes
d/^$^M delete unto next empty line
q end recording
Hope this helps,
Regards,
Garth
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!