1
0
mirror of https://git.decapod.one/brethil/dotfiles synced 2024-11-21 19:11:30 +01:00

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

This commit is contained in:
bretello 2022-03-25 08:34:09 +01:00
parent 7005372b5a
commit 782accd7ae
Signed by: brethil
GPG Key ID: 876AAC6290170FE7

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>