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

[FEATURE REQUEST]visual line mode support A or I #2167

Closed
canxer314 opened this issue Nov 22, 2017 · 6 comments · Fixed by #2993
Closed

[FEATURE REQUEST]visual line mode support A or I #2167

canxer314 opened this issue Nov 22, 2017 · 6 comments · Fixed by #2993

Comments

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


This is a FEATURE REQUEST :

Environment:

  • VSCode Version: 1.18.1
  • VsCodeVim Version: 0.10.5
  • OS: windows 7

Behavior:

Press "shift + v" toggle visual line mode, then use "j" or "k" select serval lines, then press "A" or "I" to add cursors at the end or front of all the lines selected and switch to insert mode.

This can be vary useful.

@Chillee
Copy link
Member

Chillee commented Nov 22, 2017

To be clear, this is not default vim behavior.

@canxer314
Copy link
Author

@Chillee you are right, vim do not provide this by default, but it is helpful, I used this feature in atom with vim-mode-plus for a long time and I hope I could use it in vscode

@ghost
Copy link

ghost commented Dec 13, 2017

@canxer314 In the meantime, or in case this never is implemented, there's a somewhat clunky way to add multiple cursors to the end of lines using a default VSCode option.
Shift + Alt + I adds cursors to the end of every highlighted line (if this doesn't work, open the command pallet and run the command "toggle multi-cursor modifier"), so you could do this:
* Shift + V for visual line
* j/k to select lines
* Shift + Alt + I
* <Esc> to get to normal mode, multi-cursor
* press 'a' to enter insert mode

Or, if you're okay with using a mouse, Alt + click adds a cursor where you click.

@canxer314
Copy link
Author

@aCuteLittleBox Thanks.

@shawnaxsom
Copy link
Contributor

I can take a look at this one. It would definitely be useful.

Note that there is the option also to press Ctrl+V for block mode, then I or A. But that requires everything to be lined up to some extent. It looks like there is a bug with that also where if I try that at the end of a long line, then select some shorter lines, and press A, the shorter lines' text disappears.

@shawnaxsom
Copy link
Contributor

I got this working locally this morning for the most part:

https://cl.ly/58594b79d1aa

I'll work on it further after work hours. I'll have it skip adding cursors for lines where there is no text. I will see how difficult it would be to get this to work for Visual mode v as well, right now it is just Visual Line mode shift+v.

I might look at the bugs with Visual Block mode erasing text as well, though that might end up on a separate PR.

shawnaxsom pushed a commit to shawnaxsom/Vim that referenced this issue Aug 25, 2018
shawnaxsom pushed a commit to shawnaxsom/Vim that referenced this issue Aug 26, 2018
shawnaxsom pushed a commit to shawnaxsom/Vim that referenced this issue Aug 26, 2018
shawnaxsom pushed a commit to shawnaxsom/Vim that referenced this issue Aug 26, 2018
jpoon added a commit that referenced this issue Sep 7, 2018
…append

I or A in visual/visual line mode creates multiple cursors #2167
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants