Is there a way to forward-delete in insert-mode in vim? I'm using a MacVim. I tried "Control-D", but it obviously doesn't work. I'm searching the official documentation, but cannot find. Any help would be appreciated.

link|improve this question

feedback

3 Answers

up vote 2 down vote accepted

Its the fn key and backspace (<X)) or alt and backspace (<X)).

link|improve this answer
feedback

There's no built-in way, however you can create a key map like this:

:imap <C-d> <Esc>wdiwi
link|improve this answer
Lol, it's already solved... Mac has a key set for it, check my answer. – BloodPhilia Jun 16 '10 at 20:27
1  
I prefer the following (which is portable!): inoremap <C-D> <space><esc>ce. (dfooi can be simplified into cfoo) – Luc Hermitte Jun 16 '10 at 21:20
@ BloodPhilia: Yeah I saw that, just thought someone using a different vim (not MacVim) might want a solution :) – sml Jun 17 '10 at 3:59
1  
Unfortunately, this particular mapping hides/overrides the default "dedent"/unindent mapping, which is (at least for me), pretty useful. Maybe <key>C-BS</key> instead? – Jeet Nov 15 '10 at 22:39
feedback

The beauty of Vim is its portability! Keep it agnostic.

inoremap <C-d> <Esc>lxi

edit: KISS even better!

inoremap <C-d> <Del>
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.