I use visual mode for things like this. One of the best features of visual
mode is that it supports vertical regions. You can add, remove, and modify
this way.

If you are running vi in "compatible" mode this may not be available to you.

Also to you old-time vi users (I've been using vi for almost 30 years, since
Bill Joy got tired of "ed" and wrote vi): I've recently made the switch to
gvim and found it very satisfying. All the familiar vi commands work normally,
plus all the new features. If anyone has any short, clever gvim tips I'd love
to hear them.

Michael


On Wed, 3 Jan 2007, Lior Kaplan wrote:

Hi,

Today I had to edit a lot of configuration files with VI. While editing
I wondered what's the fastest way to change line to comments by adding
"#" signs in the beginning of these lines.

1. Slowest way - do it manually.
2. Shorter - do :[range]s/^/#/ (where range can be 1,2 or .,.+3 while .
is the current line).

Any suggestions ?

Thanks.

p.s.
Please don't provide something like using other editors.

p.s.
Since on some machines I have VI and not VIM, please don't use VIM only
features.

--

Lior Kaplan
[EMAIL PROTECTED]
http://www.Guides.co.il

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]



=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to