Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking for the opposite of x. I want to insert just one character and stay in command mode.

share|improve this question
up vote 12 down vote accepted

You could map a key(-sequence) to a command sequence, f.e.:

:map <C-i> i_<Esc>r

Ctrl-i takes one character and returns afterwards.

To make it persistent, add the same line to the local or global vimrc file:

share|improve this answer
To put in a vimrc file one should leave out the : – phunehehe Dec 17 '10 at 2:05
I don't get it.. whether you do i {char} Esc or CTRL-i {char}, it's still three keystrokes. I'd say if you are going to customize your setup, just make Esc more readily available, e.g. by mapping CapsLock to it. – intuited Apr 4 '11 at 7:24

In some situations you can just use r. From :help r:

Replace the character under the cursor with {char}.

If you want more than one char, use R. (When used it enters in Replace mode. As usual, for more info, :help Replace).

Remember to run vimtutor at least once to learn some commands. The r command is used in Lesson 3.2.

share|improve this answer
op was blatantly talking about inserting, not replacing. how did this get at least 2 upvotes? – underscore_d Oct 17 '15 at 20:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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