Tip #637: execute accidently inserted commands
tip karma |
Rating 23/8, Viewed by 810
|
created: |
|
January 17, 2004 12:44 |
|
complexity: |
|
basic |
author: |
|
Jochen Behrens |
|
as of Vim: |
|
5.7 |
If you are in insert mode and typed an command for normal mode, you can use it.
inoremap <somekey> <esc>u@.
This mapping switches to normal mode, undo'es the last insertion and takes it as a command.
Most times I need it, if I typed dd and the line still remains because of Insert-Mode and the unwanted 'dd' ist somewhere
in my text.
<<Adding Vim to MS-Windows File Explorer Menu |
Editing ActiveState Perl batch files >>
Additional Notes
|