I'm using an intellij editor (Rider/Clion) with the vim plugin on mac osx and am attempting to intelligently select words in my editor, which I accomplish via an 'extend selection'/'shrink selection' keymap within Rider.

I'm happy with the above, but would like to delete the selection within one keystroke in normal mode in vim. I understand that the selection is not known to vim, so I'd like to remap my delete key to perform an i followed by backspace for eg.

I've tried:

:nnoremap <Del> i<backspace> 

And a few others with no joy

I've checked the mapping within vim via :nmap and I can see the result but when testing, the delete key remains in normal mode hence simply moves the cursor back one character.

Any help to my above conundrum (or otherwise better advice than what I'm trying to perform) would be highly appreciated!

  • Check :h keycodes I think you are looking for nnoremap <Del> i<BS>. Note that if that doesn't work because the intellij plugin doesn't support this Vim's feature that would make this question off topic for this site. – statox Jun 21 '19 at 9:29
  • If you use vim’s visual mode to make your selection, d will do it, or c to leave you in insert mode – D. Ben Knoble Jun 21 '19 at 12:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.