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: Shigio YAMAGUCHI
Subject: Re: make gtags.vim work for any dir
Date: Thu, 24 Jan 2019 09:46:18 +0900

> Yes, like this.
> Also, it works if the source file and GTAGS are not exactly in the same
> directory, but just in common path:
>
> $ cd some_random_dir
> $ vim
> :e /xxx/subdir/a.c
> :Gtags main             From now on, use /xxx/GTAGS.

Of course it is.

> Shigio, I would love if we could make the needed changes in the
> gtags.vim upstream.
> In my opinion, it's pretty useful feature.

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

2019年1月24日(木) 0:36 Andrey Butirsky <address@hidden>:
>
> Yes, like this.
> Also, it works if the source file and GTAGS are not exactly in the same
> directory, but just in common path:
>
> $ cd some_random_dir
> $ vim
> :e /xxx/subdir/a.c
> :Gtags main             From now on, use /xxx/GTAGS.
>
>
> Shigio, I would love if we could make the needed changes in the
> gtags.vim upstream.
> In my opinion, it's pretty useful feature.
>
>
> On 23.01.2019 18:21, Shigio YAMAGUCHI wrote:
> > Do you mean the following usage?
> >
> > :e /xxx/a.c             Load a file.
> > :Gtags main             From now on, use /xxx/GTAGS.
> > :e /yyy/x.c             Load another file.
> > :Gtags main             From now on, use /yyy/GTAGS.
>
> _______________________________________________
> Bug-global mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/bug-global



-- 
Shigio YAMAGUCHI <address@hidden>
PGP fingerprint:
26F6 31B4 3D62 4A92 7E6F  1C33 969C 3BE3 89DD A6EB



reply via email to

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