tags:

views:

59

answers:

3

Is there any key combination that simulate the Del in Vim insert mode? For the Backspace, there is the Ctrl-H which is very convenient, and make it easier than pushing the far away Backspace button.

+1  A: 

You can map keys yourself in vim, including insert mode. The following article reveals more details: Mapping keys in VIM

Leonid
+3  A: 

Take a look at http://vimdoc.sourceforge.net/htmldoc/insert.html There are a few more built-in key combinations for various tasks.

Also you can set your own mappings using .vimrc for example your given example is just

imap ^H <Left><Del>
Nuz
+1  A: 

On my vim installation, Del in insert mode Just Works. :help i_<Del>

If Del isn't doing what you want, you can try :fixdel. :help :fixdel has a good explanation of what that tries to fix.

If you simply wanted to simulate Del via another Ctrl-key mapping (e.g. Ctrl-D), I'd recommend the following mapping:

imap <C-D> <C-O>x

Ctrl-O in insert mode will allow you to run a single normal mode command and automatically return back to insert mode. x deletes the key under the cursor.

nicholas a. evans
Yes, Del works with with my installation also, but I wanted something easier than having to remove your right hand from its best location on the middle row, press <Del>, and then return back your hand :-)Thanks for the comment though.
Rafid K. Abdullah