2

I want the cursor to stay in the same column whilst moving up and down on tabbed lines.
But instead the cursor goes to the beginning of the line if there's no text on that line.

How do I get rid of this cursor behavior?


enter image description here

  • 1
    Per Stefan's answer, Emacs doesn't support this without adding whitespace to the end of those lines. Is there some problem this behavior is causing for you, or is it more about appearance? If this causes some other problem, perhaps we can help with that. – glucas Apr 20 '18 at 13:44
  • What @glucas said: What's the problem? Is it just that you are annoyed to see the cursor jump to the line beginning, or is there something more involved? – Drew Apr 20 '18 at 16:10
  • @Drew Yes, it's annoying to press enter and then go up a line, and then having to press tab. – John DeBord Apr 20 '18 at 19:33
  • @glucas So is there a way for Emacs to add 4 spaces (I'm using spaces not tabs) whenever I'm formatting code like this? But then obviously not add any spaces when I'm pressing enter outside of a block of code? – John DeBord Apr 20 '18 at 19:35
4

You can try quarter-plane-mode (available from GNU ELPA), but beware. Emacs's underlying engine is basically unable to do what you want; it can only place cursor where there is some text), so the package has to do funny things (e.g. it will add spaces as/when needed, IIRC) which will occasionally have side-effects that might surprise you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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