Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim: Del in Insert Mode

Tags:

vim

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.

like image 444
Rafid Avatar asked Aug 30 '10 15:08

Rafid


People also ask

How do you delete and insert in Vim?

Or, you could perhaps use the key sequence bdwi to delete the current word and go into INSERT mode. You can use bcw to go to the beginning of the current word then change the word, which leaves you insert mode. If your cursor is already on the first character of the word, that will end up deleting the previous word.

How do you quickly delete in Vim?

Deleting a single line in Vim editor: First, bring your cursor to the line you want to delete. Press the “Esc” key to change the mode. Now type, “:d”, and press “Enter” to delete the line or quickly press “dd”.

How do I forward a Vim delete?

I often use the Ctrl-w command in "Insert" mode to delete the word behind the cursor, just like I would do in Bash. In Bash, I also have a Meta-d ( Esc-d ) command for deleting the word in front of the cursor.

What is Vim insert mode?

vim has two "modes": COMMAND mode and INSERT mode. In COMMAND mode, you execute commands (like undo, redo, find and replace, quit, etc.). In INSERT mode, you type text. There is a third mode, VISUAL mode, that is used to highlight and edit text in bulk.


2 Answers

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

like image 96
Leonid Avatar answered Sep 21 '22 12:09

Leonid


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>
like image 32
Nuz Avatar answered Sep 21 '22 12:09

Nuz