Add a line above or below

Quickly add empty lines above and below with Unimpaired

If you don’t have Tim Pope’s unimpaired.vim, you should. Unimpaired adds many useful pairs of mappings including one for adding an empty line above or below your current line.

In normal mode, use [<Space> and ]<Space> to add an empty line either above or below your current line. With your cursor on the def bar line below, tap [<Space> and a line will be effortlessly inserted above while your cursor remains on its line:

def foo
end
█ef bar
end

Tap [<Space>and a line is instantly inserted:

def foo
end

█ef bar
end

Was this useful? Help us improve!

With your feedback, we can improve VimTricks. Click a link to vote: