I sometimes work with files that have longish (200+ characters) lines, and I've recently discovered the joy of :nowrap mode. It's quite convenient.

However, when I'm scrolled over to the right by a few screen widths, and I use dd to delete a line, the screen jumps back to the leftmost position of the following line.

Is there a way to avoid this? I'd prefer that the screen stay where it is, and the cursor just travel down one row. (The following line is equally long.)

1 Answer 1


You can set nostartofline to get this.

It would also make it stay on the same column while using jumps like gg or G, CTRL-F, L etc.

See :h startofline for more details.

'startofline' 'sol' boolean (default on)
    When "on" the commands listed below move the cursor to the first
    non-blank of the line.  When off the cursor is kept in the same column
    (if possible).  This applies to the commands: CTRL-D, CTRL-U, CTRL-B,
    CTRL-F, "G", "H", "M", "L", gg, and to the commands "d", "<<" and ">>"
    with a linewise operator, with "%" with a count and to buffer changing
    commands (CTRL-^, :bnext, :bNext, etc.).  Also for an Ex command that
    only has a line number, e.g., ":25" or ":+".
    In case of buffer changing commands the cursor is placed at the column
    where it was the last time the buffer was edited.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.