From 0ecbd2497cf41fe3b86f8904562cf7bd199dbd79 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Thu, 16 Mar 2017 19:56:00 -0500 Subject: [PATCH] Don't jump to last cursor position in vim for git commits --- text-editor/neovim/init.vim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/text-editor/neovim/init.vim b/text-editor/neovim/init.vim index cf8cb7d..f4000a8 100644 --- a/text-editor/neovim/init.vim +++ b/text-editor/neovim/init.vim @@ -364,9 +364,10 @@ augroup vimrc au BufWinEnter * if &fdm == 'indent' | setlocal foldmethod=manual | endif augroup END -" jump to last opened position in file +" jump to last opened position in file except in git commits +let jump_to_pos_blacklist = ['gitcommit'] if has("autocmd") - au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif + au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") && index(blacklist, &ft) | exe "normal! g'\"" | endif endif " no empty buffer on startup