From 65ec04c58e2b5c906a02fdb00a3d8bc5b2f32a65 Mon Sep 17 00:00:00 2001 From: Yao-Yu Li Date: Sun, 14 Oct 2018 03:18:13 +0800 Subject: [PATCH] Keep current directory to the directory runs vim Make the current directory stay in the directory which originally runs vim rather than the file directory (what autochdir did). --- plugin/srcexpl.vim | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/plugin/srcexpl.vim b/plugin/srcexpl.vim index dc14f81..1a29201 100644 --- a/plugin/srcexpl.vim +++ b/plugin/srcexpl.vim @@ -346,7 +346,7 @@ endfunction " }}} function! g:SrcExpl_UpdateTags() " Go to the current work directory - silent! exe "cd " . expand('%:p:h') + silent! exe "cd " . `pwd` " Get the amount of all files named 'tags' let l:tmp = len(tagfiles()) @@ -1490,8 +1490,6 @@ function! SrcExpl_Init() \ g:SrcExpl_colorSchemeList[matchstr(reltimestr(reltime()), \ '\v\.@<=\d+')[1:] % len(g:SrcExpl_colorSchemeList)] - " Auto change current work directory - exe "set autochdir" " Let Vim find the possible tags file exe "set tags=tags;" " Set the actual update time according to user's requirement