From 1c62251ea84d8d53012da687b929ca8b70c16f24 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sun, 25 May 2014 15:46:22 -0400 Subject: vimrc: allow undo of Ctrl-u and Ctrl-w in insert mode Ensure that my changes can be undone if I accidentally press Ctrl-u or Ctrl-w in insert mode. --- vimrc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/vimrc b/vimrc index 5f66e1d..64b8c18 100644 --- a/vimrc +++ b/vimrc @@ -149,6 +149,11 @@ " variable needed to be set directly. " * Move gitcommit indentation settings from vimrc to ftplugin/gitcommit " +" 2014.05.25: +" * If in insert mode I press Ctrl-u to delete a line or Ctrl-w to +" delete a word, add those changes to the undo history so that I can +" go back and don't have to remember what I typed if I want to undo. +" " Pathogen @@ -376,6 +381,11 @@ inoremap x nnoremap o ox nnoremap O Ox +" Allow undo of Ctrl-u and Ctrl-w in insert mode +" http://vim.wikia.com/wiki/Recover_from_accidental_Ctrl-U +inoremap u +inoremap u + " Show invisibles with i nnoremap i :set list! -- cgit v1.2.3