Questions tagged [insert-mode]

The mode in Vi and Vim in which you can insert text to the open document.

Insert Mode is the mode in Vi and Vim where you can insert text in the document.

You can go from Normal mode to Insert mode in several different ways, the difference is the placement of the cursor before starting Insert mode:

  • a; append, move the cursor one character forward.
  • A; append line, move the cursor to the end of the line.
  • i; insert, doesn't move the cursor.
  • I; insert before, move the cursor to the first non-whitespace character of the line.
  • o; open, begin a new line below the cursor.
  • O; open, begine a new line above the cursor.

In addition to these commands, Vim has 2 additional commands to start Insert mode:

  • gI; insert before, move the cursor to the first column.
  • gi; insert previous, move the cursor to the position Insert mode was stopped the last time.

To get back to Normal mode press the Esc key, which will set you back into normal mode.

See also:

285 questions
237
votes
6 answers

Why doesn't the backspace key work in insert mode?

Trying to delete characters in insert mode with the backspace key sometimes doesn't seem to work. I can backspace sometimes, but at other times it does nothing; the cursor doesn't go to the left, and absolutely nothing seems to happen. I noticed…
glS
  • 3,869
  • 4
  • 18
  • 16
31
votes
9 answers

arrow keys don't work in insert mode

When I hit the arrow keys in insert mode I get characters instead of navigation: I'd like to be able to use the arrow keys to navigate. Things I've tried I have set nocompatible in my ~/.vimrc (vimrc pastebin), I am using pathogen and here is my…
minseong
  • 2,313
  • 1
  • 19
  • 38
23
votes
4 answers

Undo in insert mode

Sometimes in insert mode I hit by mistake and I have to hit the backspace multiple times (depends on the indentation) to get back where I was. e.g.

This is some text []

The cursor is [] and I hit :

nobe4
  • 16,033
  • 4
  • 48
  • 81
18
votes
3 answers

Speed bump on O (Insert to Normal to Insert new line above cursor)

Often when I'm in Insert mode, I'll hit Esc to get into Normal mode, and then immediately hit O to begin a new line above the cursor and go into Insert mode there. But when I do that, there is a 1-second delay after I hit the O before there is any…
Don Hatch
  • 291
  • 1
  • 6
16
votes
2 answers

Can I create my own mode in Vim?

We have a few modes in Vim. The most commonly used are: Normal (=Command), Insert, and Command-line, but also some sub-modes, like: Replace, Visual-line (V) or Visual-block (Ctrl+v). Does Vim support the creation of some user-defined submode? How to…
Mesco
  • 466
  • 6
  • 12
14
votes
1 answer

How to achieve automatic list numbering in vim?

Contracts etc formal things need numbered lists. 1. Some text 2. More text 2.1. Sub-section text etc. The key is to eliminate the manual re-numbering when inserting or deleting a list item. Is this possible with vim? List numbering consistency…
lkraav
  • 271
  • 1
  • 7
8
votes
3 answers

Remove the insert delay after entering insert in a read-only file

When entering or doing any command mode modifications to a read only file for the first time you will get the warning W10: Warning: Changing a readonly file That's fine, but this also introduces a second or two delay before the action actually…
5
votes
1 answer

How do I show invisible characters only as I type them?

I know that I can use :set list to show invisible characters. However, I am interested in a thing I've seen in many other editors, which is not to show or not show invisibles outright but show them only while typing For example, when I press Tab it…
naiveai
  • 355
  • 4
  • 9
5
votes
3 answers

Ctrl-W in insert mode erases only up to where insert was started

I frequently use in insert mode to back up when I mistype things. I've noticed some odd behavior if I start insert mode when in the middle of a word. For example, if I have the following line (cursor location indicated by ^): I love to use…
Los Frijoles
  • 161
  • 4
4
votes
3 answers

Insert the word which is above the cursor?

I know that in insert mode CTRL-Y can insert the character above the cursor. Is there a way of inserting the word above the cursor in insert mode ?
user3203476
  • 399
  • 2
  • 8
4
votes
1 answer

Can I temporarily disable all vim-like keybinding?

I use vim for editing everything. Occasionally while I have vim open someone else will want to write something for me. (My coworkers explaining code, friends helping me write something/leaving notes for me, etc.) As I'm sure you all know, vim isn't…
DJMcMayhem
  • 17,581
  • 5
  • 53
  • 85
3
votes
2 answers

Backspace does nothing

I am on a Unixware 7.1 box and can't seem to get VI to backspace properly. The current behavior is when you insert new characters and backspace over them, it will just shift the cursor to the left. However, if I open a fresh file and do not type…
user3080539
  • 31
  • 1
  • 2
3
votes
1 answer

vi and Vim does not show "insert" or "replace" popup

When editing with vi or Vim "insert" or replace popup text does not appear when in insert or replace mode. This problem occurs both with Windows 7 and Putty interface and with Mac and Iterm2 interface. Also, the problem is strange since it does not…
Jess
  • 31
  • 1
  • 3
2
votes
1 answer

Why does the null character in insert mode insert the contents of the ". register?

When I enter insert mode and type , vim inserts the last inserted text, then exits insert mode. My guess is it's using the ". register. prints a null character. However when I enter the command :imap, it doesn't list any…
Floegipoky
  • 457
  • 5
  • 13
2
votes
0 answers

Why does reverse indent enter Hebrew?

Today I learned that you can use in insert mode to toggle "Reverse insert" on and off, provided that :set allowrevins is set. This sounds like a useful feature (Albeit an obscure and strange feature), so I would like to have it on. However,…
DJMcMayhem
  • 17,581
  • 5
  • 53
  • 85
1
2 3