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 25Change Columns of Text

We can use Visual-Block mode to insert text into several lines of text simultaneously.

Visual-Block mode is not just useful to us when working with tabular data. Oftentimes, we can benefit from this feature when working with code. For example, take this snippet of (suboptimal) CSS:

 li.one a{ background-image: ​url('/images/sprite.png')​; }
 li.two a{ background-image: ​url('/images/sprite.png')​; }
 li.three a{ background-image: ​url('/images/sprite.png')​; }

Suppose that the sprite.png file has been moved from images/ into a components/ directory. We’ll need to change each of these lines to reference the file’s new location. We could do this using Visual-Block mode as shown in Table ...

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