diff --git a/vim/vimrc b/vim/vimrc index 3340943..5905316 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -84,7 +84,10 @@ if has('persistent_undo') endif " Return to last edit position when opening files (from amix's vimrc) -au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif +au BufReadPost * if ! exists('b:dotgitFolder') | if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif +" set a marker to avoid returning to the previous position in .git folders +" (avoids returning to previous position for COMMIT_EDITMSG etc ) +au BufReadPost */.git/* let b:dotgitFolder = 1 " Bash like keys for the command line cnoremap