vim: do not return to previous edit position for files in .git

pull/6/head
bretello 2022-03-25 08:34:09 +01:00
parent 7005372b5a
commit 782accd7ae
Signed by: brethil
GPG Key ID: 876AAC6290170FE7
1 changed files with 4 additions and 1 deletions

View File

@ -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 <C-A> <Home>