Tip #466: Insert one character only
tip karma |
Rating 110/51, Viewed by 2738
|
Read and edit this tip on the
Vim tip wiki.
The wiki may have a more recent version of this tip.
created: |
|
April 30, 2003 10:10 |
|
complexity: |
|
basic |
author: |
|
johnmaxa |
|
as of Vim: |
|
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 _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.
<< generic xml imap to make an element of any word you type |
vim windows displaying output inside vim window >>
Additional Notes
Anonymous,
May 23, 2004 23:34
|
Huhn, I've wanted this feature for years -- and expected it would take source modifications to make it happen. Such a simple little script. Thanks!
|
Bertram Scharpf,
March 22, 2005 6:39
|
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>
Bertram
|
|