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

Problem with insert mode after highlighting in visual mode #3174

Closed
shadyalfred opened this issue Oct 29, 2018 · 3 comments
Closed

Problem with insert mode after highlighting in visual mode #3174

shadyalfred opened this issue Oct 29, 2018 · 3 comments

Comments

@shadyalfred
Copy link

shadyalfred commented Oct 29, 2018

So I am in Visual Mode, I highlight some text (basically to add brackets around them, it works in normal VS code configuration, highlighting stuff then adding brackets or quotes to them) then I enter insert mode using shift + i, it enters insert mode but the selection I made is gone. Am I using wrong key bindings or is it something I should change in the vim extension settings?

You can try it by:

  1. Highlight text in Visual mode
  2. Press shift + i to insert text
  3. The selected text is unselected and you just insert text normally

In the normal VIM the selected text should have remained selected so that I can add brackets or quote marks to it 'like this'

  • Extension (VsCodeVim) version: 0.16.12
  • VSCode version: 1.28.2 (system setup)
  • OS: Windows 7 64bit
@shadyalfred
Copy link
Author

Update:
After looking up, it turned that VIM isn't supposed to work this way. After the visual select you press shift + s + (whatever kind of parentheses or quote marks you would like to add).
If you want to change a single quote into double quotes, in normal mode c + s + ' + " (change surrounding from ' into ")

@mxvoloshin
Copy link

have the same question, tried the shift + s but it deletes the selection

@EugenePopovych
Copy link

Update: After looking up, it turned that VIM isn't supposed to work this way. After the visual select you press shift + s + (whatever kind of parentheses or quote marks you would like to add). If you want to change a single quote into double quotes, in normal mode c + s + ' + " (change surrounding from ' into ")

Please take into account that this works only with vim.surround (https://github.com/tpope/vim-surround) plugin installed.

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

No branches or pull requests

3 participants