Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

virtualedit=onemore #1632

Open
jbaxleyiii opened this issue May 3, 2017 · 18 comments
Open

virtualedit=onemore #1632

jbaxleyiii opened this issue May 3, 2017 · 18 comments

Comments

@jbaxleyiii
Copy link

  • 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!

@Chillee
Copy link
Member

Chillee commented May 3, 2017

Is that so you can move your cursor to the "newline" character and delete it?

@jbaxleyiii
Copy link
Author

@Chillee or start an insert after the last character

@Chillee
Copy link
Member

Chillee commented May 3, 2017

microsoft/vscode#13960

I think we need to wait for an upstream change.

@jbaxleyiii
Copy link
Author

Oh gotcha! Thanks!

johnfn added a commit that referenced this issue May 13, 2017
Fixes #1400, #612, #1632, #1634, #1531, #1458: Tab isn't handled properly for insert and visualblockinsert modes
@Chillee
Copy link
Member

Chillee commented May 17, 2017

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...

@kinnedev
Copy link

Has anyone found a solution for this?

@Ryanauger95
Copy link

Anyone?

@ghost
Copy link

ghost commented May 9, 2019

I really want this...

@someshkar
Copy link

someshkar commented Jul 7, 2019

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!

@Ryanauger95
Copy link

@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

@someshkar
Copy link

@piedpieper Wow thanks so much! I've been needing this ever since I started using Vim!

@unacceptable
Copy link

unacceptable commented Sep 12, 2019

@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. 🙂

@J-Fields
Copy link
Member

@ScriptMyJob Why not J?

@unacceptable
Copy link

@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. 🙂

@J-Fields
Copy link
Member

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.

@elvindsouza
Copy link

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"
      ]
    }
  ],```

@J-Fields J-Fields added this to the Backlog candidates milestone Oct 15, 2021
@J-Fields J-Fields changed the title virtualedit=onemore virtualedit=onemore Oct 26, 2021
@gruvw
Copy link

gruvw commented Oct 5, 2022

Hello, where is this at ?
I really want this please.

@uncleSlayer
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests