Vim Tips Wiki
Advertisement

Duplicate tip

This tip is very similar to the following:

These tips need to be merged – see the merge guidelines.

Tip 466 Printable Monobook Previous Next

created April 30, 2003 · complexity basic · author johnmaxa · version 5.7


I have not yet seen this idea yet. But early in my use and love of Vim, I got frustrated in command mode when I wanted to insert just one character of text. So I put this in my vimrc:

"insert one character
noremap <somekey> i<Space><Esc>r

I think it has been one of the most time saving mappings -- and I have remapped most of my keyboard.

Comments

This won't be repeated by the . command.

Therefore I define

nnoremap <somekey> :exec "normal i".nr2char(getchar())."\e"<CR>
nnoremap <someother> :exec "normal a".nr2char(getchar())."\e"<CR>

Advertisement