" " Mappings that let you undelete the previously deleted text using ^W or ^U " in insert mode. To use just source this file and to undo the previous " deletion, just type ^X^U. " " Author: Hari " Last Modified: 16-Nov-2001 @ 14:57 " Requires: Vim-6.0 " Version: 1.0 " This would have happened to everyone at least once. You start typing a new " line and press ^U and kill the line, and then realize you can't get that " line back. It is painful that you can't undo in insert mode isn't it? This " little script aims at adding a rudimentary backup mechanism by which you can " get back previously killed text through ^U or ^W. To undo what you have just " done (through ^W or ^U) use ^X^U or ^X^W. " " TODO: Currently the script doesn't keep track of the start column where the " editing started, so it might undo a little too much text, but essentially " you are not loosing anything. You just have to manually edit the text that " is put by undo. if exists("loaded_undoins") finish endif let loaded_undoins=1 inoremap =SaveWordToBeDeleted() inoremap =SaveLineToBeDeleted() " " Define a default mapping if the user hasn't defined one. " if !hasmapto('UndoInInsModeUndoKey') imap UndoInInsModeUndoKey endif " The main plugin mapping. inoremap