Vim icon indicating copy to clipboard operation
Vim copied to clipboard

Cannot use backspace to delete selected text in INSERT MODE

Open wangadong opened this issue 10 years ago • 10 comments

Please thumbs-up 👍 this issue if it personally affects you! You can do this by clicking on the emoji-face on the top right of this post. Issues with more thumbs-up will be prioritized.


What did you do?

Enter INSERT MODE, use mouse to select text, then press Backspace to delete the text

What did you expect to happen?

All selected text should be deleted

What happened instead?

Only deleted the last character

Technical details:

  • VSCode Version: 1.6.0
  • VsCodeVim Version: 0.3.5
  • OS: macOS Sierra

wangadong avatar Oct 11 '16 05:10 wangadong

If anything then selecting text with the mouse should enter visual mode, where backspace should shrinl the selection by one character.

andlrc avatar Oct 11 '16 08:10 andlrc

hi @andlrc maybe I was indulged by Sublime vi mode. But I do think that is more intuitive behavior.

wangadong avatar Oct 11 '16 08:10 wangadong

What you want is something called select mode. You can toggle between select mode and visual mode with <C-g>. At least in vim it works like that.

andlrc avatar Oct 11 '16 08:10 andlrc

@andlrc in MacVim, you can do what @wangadong is suggesting, I think it is fair the way he wrote it, and I agree it is annoying

xconverge avatar Oct 12 '16 02:10 xconverge

This bug is legit. Backspace, even in visual mode, should delete whatever is selected.

If someone wants to implement Select Mode, please by all means go ahead. :)

johnfn avatar Oct 12 '16 02:10 johnfn

Not just selecting by mouse, if you select the content by cmd+a and then press backspace, only one character is deleted as well.

rebornix avatar Oct 13 '16 18:10 rebornix

@johnfn even visual mode? For me visual mode, backspace moves the end cursor back one position

xconverge avatar Oct 18 '16 15:10 xconverge

@andlrc I think the part you missed was that he is using the mouse once already in INSERT mode.

Press i, then select text with arrow keys + modifier or mouse, then press backspace. That is what I addressed. Regular mouse selections while in normal put you into visual mode

xconverge avatar Oct 18 '16 15:10 xconverge

@xconverge heh, I'm using macvim, maybe it does something weird?

johnfn avatar Oct 18 '16 23:10 johnfn

@xconverge Also selecting duplicate with ctrl+d on insert mode and pressing backspace seems to delete only first occurrence.

Am I missing something ?

Have a look at here https://github.com/VSCodeVim/Vim/issues/1358

sethstha avatar Mar 11 '17 07:03 sethstha