Language Selection

English French German Italian Portuguese Spanish

The Cult of Linux

Filed under
Linux

Ever wanted to comment out multiple lines of code while writing shell scripts in vi, but didn't want to pound your keyboard for half an hour doing it?

(I#Escape j.j.j.j. = carpal tunnel)

Here's the nerdy way to do it:

:.,+N-1 s/^/#/g

Full Details

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

To be honest

I've never really wanted to do anything in vi. Smile

More in Tux Machines

today's howtos

Leftovers: Gaming

Red Hat Summit and News

Leftovers: Ubuntu