aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2014-06-03 22:25:39 -0400
committerTeddy Wing2014-06-03 22:26:54 -0400
commite4e0419337001ea431dd70ce4ddc5427a94f9d4f (patch)
tree5331d3cc872c710dd94b05d868a54317ebfdd611
parent0484e8661f0becfe7f43224bb9066a83ea4e3924 (diff)
downloaddotvim-e4e0419337001ea431dd70ce4ddc5427a94f9d4f.tar.bz2
vimrc: ensure an undo entry is created when saving in Insert mode
Add a `<c-g>u` to my save command mapping in Insert mode so I can be sure that my edits are progressively fed to the undo tree.
-rw-r--r--vimrc5
1 files changed, 4 insertions, 1 deletions
diff --git a/vimrc b/vimrc
index 99a59e8..f5f4990 100644
--- a/vimrc
+++ b/vimrc
@@ -190,6 +190,9 @@
" 2014.06.03:
" * Ignore "vendor/" directories when searching in Command-T. Makes it
" easier to search in Ruby projects.
+" * Save an undo (using Ctrl-g + u) when saving in Insert mode. It didn't
+" appear to be doing so before and I want to make sure that an undo
+" entry is created every time I save.
"
@@ -423,7 +426,7 @@ vnoremap <S-Tab> <Esc>
" Control-h to save (Why 'h'? Because it seemed to be a non-important combo
" across modes, and because bash by default doesn't let me map Control-s)
nnoremap <c-h> <esc>:update<cr>
-inoremap <c-h> <esc>:update<cr>a
+inoremap <c-h> <c-g>u<esc>:update<cr>a
vnoremap <c-h> <esc>:update<cr>v
" Preserve indentation on empty lines