Powerful editor

 | Computers and stuff | 0 Comments | 0 TrackBacks
Here's something handy for vim power users.

:%s/.*/(&)/g
For those unfortunate souls out there who do not have a clue about what this might be, this regular expression global substitution command will enclose all lines in the current file within parentheses.

Or have even more fun by reversing all of the lines in a file by issuing the following succinct command:

:g/^/mo0
I'm just sawing swiftly through the book Learning the vi and Vim Editor and learning all kinds of nifty stuff to make my editing sessions even more efficient.

No TrackBacks

TrackBack URL: http://www.kiffingish.com/cgi-bin/mt/mt-tb.cgi/299

Leave a comment

Recent Entries

A walk along the Keizersgracht
Too often one is so consumed by a jungle of intertwined thoughts that the beauty of the nearby surroundings ... »
Popularity is fickle
The popularity of a given next generation technology is very fickle, and its success or failure depends on many ... »
Where was Kiffin really buried?
Hi There seems to be some confusion on the current resting place of Kiffin Rockwell, some say that his ... »
Going to Portugal
Normally the week just before I leave for summer vacation, I spend hours on end desperately searching for some ... »
A human language
These days it is not very often that a new and exciting Perl book comes along. That's why I ... »