Skip to Content
Practical Vim, 2nd Edition
book

Practical Vim, 2nd Edition

by Drew Neil
October 2015
Intermediate to advanced
356 pages
7h 54m
English
Pragmatic Bookshelf
Content preview from Practical Vim, 2nd Edition
Tip 70Act Upon a Collection of Files

So far, we’ve stuck to tasks that were repeated in the same file, but we can play back a macro across a collection of files. Once again, we’ll consider how to execute the macro in parallel and in series.

Let’s start with a set of files that look something like this:

 # ...[end of copyright notice]
 class​ Animal
 # implementation
 end

We’ll wrap the class in a module to end up with this:

 # ...[end of copyright notice]
 module​ Rank
 class​ Animal
 # implementation...
 end
 end

Preparation

Source these lines of configuration to reproduce the examples in this tip:

 set​ nocompatible
 filetype​ plugin indent ​on
 set​ hidden
 if​ has(​ ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning the vi and Vim Editors, 8th Edition

Learning the vi and Vim Editors, 8th Edition

Arnold Robbins, Elbert Hannah
Modern Vim

Modern Vim

Drew Neil
Learning the vi and Vim Editors, 7th Edition

Learning the vi and Vim Editors, 7th Edition

Arnold Robbins, Elbert Hannah, Linda Lamb

Publisher Resources

ISBN: 9781680501629Errata Page