The problem
The Del key generates the code ^[[3~
in my urxvt
terminal on GNU/Linux, and might generate a similar code in your OS X terminal.
My theory is that Vim for some reason doesn't recognize any keybinding for the delete key, and simply tries to interpret the string ^[[3~
as input instead. ^[
is the keycode for the Esc key (which puts you in normal mode), and ~
is the Vim command for changing the case of a letter (from normal mode).
You can confirm the keycodes I mentioned by pressing Ctrl+V Esc and Ctrl+V Del from insert mode in Vim. Ctrl+V means that the next character should be inserted as text instead of being interpreted by the editor.
The solution
As for the solution, try editing your Vim configuration file (presumably ~/.vimrc
):
vim ~/.vimrc
And append the following code to it:
nmap
Ctrl+V Del
x
imap
Ctrl+V Del
Ctrl+V Esclxi
I hope this helps :)