« Matias - Tactile Pro | Main | Prevent DS_Store files being created on remote volumes »

vi - search replace with command

To search for a string, and then perform a vi command :

:g/string/command

for instance:

:%g/endofline$/join

will search for the string "endofline$" and then append the next line to any line that matches.

Vim documentation: http://vimdoc.sourceforge.net/htmldoc/

About

This page contains a single entry from the blog

The previous post in this blog was Matias - Tactile Pro.

The next post in this blog is Prevent DS_Store files being created on remote volumes.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 3.33