← Back to Upcase

Vim append 2 lines


(Charlieanna ) #1

How do I append 2 lines with fewer key strokes ? Right now I do ESC o ESC o.


(Geoff Harcourt) #2

If the lines are consecutive, you could stay in insert mode and just jump to the next line with Enter?


(Charlieanna ) #3

what if I want to add 5 lines?


(Joe Ferris) #4

The o action accepts a range, so you can do 5o<Esc> to insert five lines. Not sure what those blank lines are getting you, though!


(Andrew Broman) #5

Tim Pope’s unimpaired.vim provides, among many other nice shortcuts, “]” to add a line after the current one, and without entering insert mode. Similarly, “[” adds a line above the current line, and either one can take a preceding number.

Most of the unimpaired shortcuts are pairs starting with “[” and “]”.