aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2017-07-04 12:30:52 +0200
committerTeddy Wing2017-07-04 12:35:56 +0200
commit23e8f0b598d92dfa8a223acd7cc154baa6713075 (patch)
tree4cf3b4526e37175dda21384696a0081b9d95a7fa
parentbfd37103f1f7b1c6a642f338dc44863228d184e3 (diff)
downloaddotvim-23e8f0b598d92dfa8a223acd7cc154baa6713075.tar.bz2
vimrc: Add ZA mapping to update all buffers and quit
Tested this out for a while without committing it and it turns out I actually started using this mapping frequently enough, so I'm saving it. The real impetus for this is that I recently (in the last couple months) set: $ git config commit.verbose 1 to get a diff of changes to be committed in my Vim commit buffer. This is really handy. Often I end up opening Vim windows to see the rest of the diff while still having my commit message open and visible. Thus my normal workflow of writing a commit message and committing with ZZ no longer works in these cases where there are multiple windows open. To more quickly save the commit message and quit all windows, this command comes in really handy.
-rw-r--r--vimrc6
1 files changed, 6 insertions, 0 deletions
diff --git a/vimrc b/vimrc
index 821d5cc..b2ab0a6 100644
--- a/vimrc
+++ b/vimrc
@@ -369,6 +369,9 @@
" 2017.05.04:
" * Add <leader>sm mapping to split chained method calls.
"
+" 2017.06.05:
+" * Add ZA mapping to save all buffers and quit.
+"
" Pathogen
@@ -595,6 +598,9 @@ nnoremap <c-h> <esc>:update<cr>
inoremap <c-h> <c-g>u<esc>:update<cr>a
vnoremap <c-h> <esc>:update<cr>gv
+" Update all files and quit
+nnoremap ZA :xall<cr>
+
" Preserve indentation on empty lines
" http://stackoverflow.com/a/7413117
inoremap <CR> <CR>x<BS>