Skip to content

Commit 0880e92

Browse files
CHG: there was a bug when using git difftool (error message complaining about path), this is now fixed
1 parent 82e0adb commit 0880e92

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • externalpackages/vim/addons

externalpackages/vim/addons/vimrc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,9 @@ inoremap <s-tab> <c-r>=InsertTabWrapper ("backward")<cr>
203203
"source ~/.exrc
204204
set wildmenu
205205

206-
"Change to directory of current file automatically
207-
autocmd BufEnter * lcd %:p:h
206+
"Change to directory of current file automatically (handle git difftool
207+
"gracefully)
208+
autocmd BufEnter * if !&diff && empty(&buftype) && isdirectory(expand('%:p:h')) | silent! execute 'lcd' fnamemodify(resolve(expand('%:p')), ':h') | endif
208209
" ----------------------------------------------------------------------}}}
209210

210211
" Abbreviations {{{

0 commit comments

Comments
 (0)