Practical Vim (for Kathryn Amaral) by Drew Neil

Practical Vim (for Kathryn Amaral) by Drew Neil

Author:Drew Neil
Language: eng
Format: mobi
Tags: Pragmatic Bookshelf
ISBN: 9781934356982
Publisher: The Pragmatic Bookshelf, LLC (383138)
Published: 0101-01-01T00:00:00+00:00


Keystrokes Buffer Contents

{start}

​ ​2) line two​​

​ ​1) line one​​

​ ​3) line three​​

dd

​ ​1) line one​​

​ ​3) line three​​

p

​ ​1) line one​​

​ ​2) line two​​

​ ​3) line three​​

The p command knows that this time we’re dealing with a line-wise chunk of text, so it does the thing we would expect: it pastes the contents of the unnamed register after the current line. Remember, when we pressed xp in the previous example, the p command pasted after the current character.

The ddp sequence could be considered to stand for “Transpose the order of this line and its successor.”

Duplicating Lines

If we want to create a new line of text that’s broadly similar to another line but with one or two small differences, we can give ourselves a head start by duplicating a line and using it as a template. In Vim, a line-wise yank followed by a put operation does the trick:



Loading...
Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.