Alex Rivera | Logout

Is there any way to insert a space in normal mode?

Asked 2012-04-28T14:32:32.737
41

I'm just starting to use vim.

I would like to know if there is a simple default key binding that will allow me to add a space in normal mode.

If not what is the next best alternative?

vim
Edit
Report

2 Answers

9

Insert a space after the cursor:

a<space><esc>

Before:

i<space><Esc>

Replace the character under the cursor with a space:

r<space>
answered 2012-04-28T16:02:55.797
6

You could create a macro. To create a macro type q followed by any letter in the normal mode. Thus to create a macro with the name x you would type qx. Then all you need is to enter into the insert mode type space and escape back to the normal mode. Once you are done type q to save the macro. From here every time you want to insert a space in the normal mode type @x.

The keystrokes: qxi <Esc>q

answered 2012-04-30T11:03:20.817

Your Answer