Vim ignore file spec in autocommand

I have a vim config entry to revert to the last position in a file. Is there a way to ignore git commit messages?

autocmd BufReadPost *
 \ if line("'\"") > 0 && line("'\"") <= line("$") |
 \   exe "normal! g`\"" |
 \ endif

      

+3


source to share


1 answer


Perhaps like this:



autocmd BufReadPost *
    \ if expand('%:p') !~# '\m/\.git/' && line("'\"") > 0 && line("'\"") <= line("$") |
    \     exe "normal! g`\"" |
    \ endif

      

+4


source







All Articles