Welcome to the Power Users community on Codidact!
Power Users is a Q&A site for questions about the usage of computer software and hardware. We are still a small site and would like to grow, so please consider joining our community. We are looking forward to your questions and answers; they are the building blocks of a repository of knowledge we are building together.
Can I prevent Vim from treating the end of a line as a separate valid cursor position?
I've been trying to set up a system in Vim that lets me treat a document full of spaces like a "text canvas", by overwriting them via R and so forth. Basically, it creates a temporary file with 23 (to allow for the Vim status line) lines of 80 spaces (so I can "draw" in the last column) each, and then launches Vim with a custom config file with some key-bindings and such to facilitate that kind of editing.
The problem I've encountered is with the line endings. Even in replace mode, it's possible to type past the end of the original line (where there is nothing to replace). So if I "paint" a character on the right-hand side of the terminal window, the cursor visually moves to the left side of the next line, but logically it is still on the same line (in column 81). Typing another character doesn't simply put it where the cursor is; either the rest of the document jumps down a line (if line-wrapped) or else Vim shifts everything over to the left to re-center the cursor so I can "continue the line" (otherwise).
Similarly, although I have it configured so that the left and right arrow keys will wrap lines in replace mode, actually I have to press them twice at line ends to get the desired result.
How can I make this work more smoothly?

1 comment thread