Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

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?

+5
−0

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?

History

1 comment thread

Hmm. Not having 'onemore' in the virtualedit setting makes it work like this in normal mode... but no... (1 comment)

Sign up to answer this question »