Nudge current line up or down

3.5
(291)

We recently wrote about how to reposition the current line to the top, middle, or bottom of the current viewport. This can help you get a better view of the working area. But there is another related tip that can give you finer-grained control over the position of your current line: Move the current line up or down one with ctrl-e and ctrl-y.

  • ctrl-e – Repositions the current line in the viewport up one line. Your cursor remains on the present line, but the line shifts upward exposing an additional line of code below.
  • ctrl-y – Repositions the current line in the viewport down one line. Your cursor remains on the present line, but the line shifts downward exposing an additional line of code above.

Here’s a quick screencast of both of these:

How useful was this tip?

Average rating 3.5 / 5. Vote count: 291

No votes so far! Be the first to rate this tip.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Written by

Colin Bartlett

105 Posts

Vim enthusiast and software developer for more than 20 years.
View all posts