bug-global
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: make gtags.vim work for any dir


From: Andrey Butirsky
Subject: Re: make gtags.vim work for any dir
Date: Thu, 24 Jan 2019 17:01:13 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:65.0) Gecko/20100101 Thunderbird/65.0

Shigio, I think there is no need to worry about the directory changing -
it occurs only for the process spawned by system() function, that is -
'global' process itself, and doesn't influence Vim environment in any
way. So every 'global' process has it's own isolated current directory
which is set up by the script.
You can try it yourself by checking :pwd before and after running a
:Gtags from the script with my changes.

About GTAGSLIBPATH, I have idea how to deal with it.
There is already special file 'GTAGSROOT':
"If environment variable GTAGSROOT is not set and file �GTAGSROOT�
exists in the same directory as �GTAGS� then global sets GTAGSROOT to
the contents of the file."
Could we implement the same file for GTAGSLIBPATH maybe?


On 24.01.2019 03:46, Shigio YAMAGUCHI wrote:
> I think changing the directory should be done explicitly, because
>
> 1) Changing the directory also may affect other plugins.
> 2) With GTAGSLIBPATH, users may find it difficult to understand
>    which project they belong to now.
> 3) Unlike emacs, vi traditionally does not do automatic directory
>    change.
> 4) Automatic directory change is a pretty big specification change.
>
> Is not it achievable with ':cd %:h' alone?
>
> :e /xxx/a.c                     Load a file.
> :cd %:h                         From now on, use /xxx/GTAGS.
> :Gtags main
> :e /yyy/x.c                     Load another file.
> :Gtags main                     Stil use /xxx/GTAGS
>
> You can control project changes freely with this method.
> What do you think?
>
> Regards,
> Shigio



reply via email to

[Prev in Thread] Current Thread [Next in Thread]