Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to keep cursor in constant horizontal position (column) while scrolling window (or moving cursor) up and down?

For example if I have file with such lines:

(I put . in places where there is space)

When I have cursor at the end of "test" word and then move it down (or scroll window), cursor changes it's horizontal position to the last character of current line. It is quite annoying when I edit files with long lines without wrapping, because if I scroll window horizontally to some position and then want to go down some lines and there happend to be a short line, then my whole window is automatically scrolled horizontally to the end of this short line and I have to scroll it back to it's previous position manually.

How this behaviour can be changed?

share|improve this question
up vote 3 down vote accepted

The way I solve that is to set the 'virtualedit' option:

:set virtualedit=all
share|improve this answer
Thanks! It is exactly what I was looking for! – klew Jun 23 '11 at 18:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .