1

I want to delete everything from the point of the cursor to the front of line with Command + Delete on insert mode. So I wrote the following on ~/.vimrc.

inoremap <D-Bs> <C-u>

But this inserts a tab at the front of the line, not delete.

I'm not even sure why, but how can I delete everything to the front of the line?

Here is the result of :imap <d-bs>.

enter image description here

And typing Control + U deletes to the front of the line on insert mode. Just the key remapping with <D-Bs> doesn't...


I'm still not sure why this happens, but launching vim without ~/.vimrc ($vim -u NONE) still has this issue.

Adding set backspace=indent,eol,start doesn't work, either.

2
  • FWIW, My terminal doesn't even get command-backspace as anything other than backspace. In macvim, this worked just fine.
    – D. Ben Knoble
    Jan 21, 2021 at 18:08
  • @D.BenKnoble I found that in MacVim the command and delete works fine. Only when I launch vim on Terminal does it not work properly.
    – Blaszard
    Jan 22, 2021 at 4:53

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.