Vim
Vim copied to clipboard
`virtualedit=onemore`
- Click thumbs-up 👍 on this issue if you want it!
- Click confused 😕 on this issue if not having it makes VSCodeVim unusable.
The VSCodeVim team prioritizes issues based on reaction count.
Feature Request:
I was wondering how to set virtualedit=onemore but couldn't find it in the docs / playing around with settings? Is this currently possible? If not it would REALLY be awesome to have!
Is that so you can move your cursor to the "newline" character and delete it?
@Chillee or start an insert after the last character
https://github.com/Microsoft/vscode/issues/13960
I think we need to wait for an upstream change.
Oh gotcha! Thanks!
Wait actually I'm dumb. This is completely possible to implement right now. Virtualedit in general is impossible, but one more is totally possible.
Hmm. I can't guarantee that how it could be implemented right now is bug free though...
Has anyone found a solution for this?
Anyone?
I really want this...
I recently started using VSCodeVim instead of my (fairly) extensive vim config. My main apprehensions with the plugin were mapping jk to Esc and using the virtualedit+=onemore feature.
The first one seemed like an easy fix after looking at the documentation, but the second one not so much. I'd really appreciate if you could add the one more character at line endings. For me at least, it's the only reason I'm not switching right away, because I find it very annoying to go into insert mode at the last character and then press the right arrow key to go one more character left in insert mode.
Thanks a ton!
@someshkar you can use 'A' to go past the end of the line and enter insert mode, or 'a' to go into insert mode after the next character
@PiedPieper Wow thanks so much! I've been needing this ever since I started using Vim!
@Ryanauger95 has a great point if you are going to append to a line.
I, however, would like this functionality so that I can drop into visual mode and delete the carriage return and some leading whitespaces like so:
// Who does this? :/
}
else {
For this, I would do the following:
# Note this works only with whichwrap
:<linenumber>$lvwhhd
This will transform the above lines into:
} else {
Instead, now I have do the following to get the same results:
:<linenumber>$lvwhhdi<Backspace><Esc>
That extra i<Backspace><Esc> is really messing my workflow up. 😞
I guess when I run into stuff like this, for now, I will just switch back to vim, but it would be nice to have this option in the future so I won't have to switch text editors.
EDIT:
I guess instead of i<Backspace><Esc> I could do dh, but that is still too much typing. 🙂
@ScriptMyJob Why not J?
@J-Fields - My God man! I have been using vim for this long and I didn't know about this! You have changed my life today. 🙂
For future reference: this is possible, but it probably would be a decent lift as the entire codebase assumes you can't be on the EOL character except in visual mode. The first step in an implementation would be to skip the logic in handleSelectionChange that prevents you from selecting past the last character.
Wait actually I'm dumb. This is completely possible to implement right now. Virtualedit in general is impossible, but one more is totally possible.
Hmm. I can't guarantee that how it could be implemented right now is bug free though...
newB here, but maybe this is what you're looking for? The following snippet would go in your settings.json, and has the same functionality(for my use case) as virtualedit onemore. i wanted to be able to hit the '-' to go one character after the eol in normal mode and then press i(force of habit)
{
"commands": [
"workbench.action.showCommands"
]
},
{
"before":[
"-"<-----insert your preferred key, mine is 0 for soft bol and - for eol
],
"commands":[
"cursorEnd"
]
}
],```
Hello, where is this at ?
I really want this please.
@someshkar you can use 'A' to go past the end of the line and enter insert mode, or 'a' to go into insert mode after the next character
Thanks for this.