We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 82e0adb commit 0880e92Copy full SHA for 0880e92
1 file changed
externalpackages/vim/addons/vimrc
@@ -203,8 +203,9 @@ inoremap <s-tab> <c-r>=InsertTabWrapper ("backward")<cr>
203
"source ~/.exrc
204
set wildmenu
205
206
-"Change to directory of current file automatically
207
-autocmd BufEnter * lcd %:p:h
+"Change to directory of current file automatically (handle git difftool
+"gracefully)
208
+autocmd BufEnter * if !&diff && empty(&buftype) && isdirectory(expand('%:p:h')) | silent! execute 'lcd' fnamemodify(resolve(expand('%:p')), ':h') | endif
209
" ----------------------------------------------------------------------}}}
210
211
" Abbreviations {{{
0 commit comments