CTRL-] jumping for local variable

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

CTRL-] jumping for local variable

Woody Wu
Hi,

When using ctags,  CTRL-] does not work for local declared variables,
in the case, I have to use gD to do the jumping.  Does this behavior
changeable? I hope I can always use CTRL-] and CTRL-T.

Thanks.

--
Life is the only flaw in an otherwise perfect nonexistence
    -- Schopenhauer

narke
public key at http://subkeys.pgp.net:11371 ([hidden email])

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: CTRL-] jumping for local variable

Tony Mechelynck
On 09/05/10 05:57, Steven Woody wrote:
> Hi,
>
> When using ctags,  CTRL-] does not work for local declared variables,
> in the case, I have to use gD to do the jumping.  Does this behavior
> changeable? I hope I can always use CTRL-] and CTRL-T.
>
> Thanks.
>

I think it's intentional. Let's say you have a lot of functions all over
your code with in each of them a local loop counter named i -- if ctags
were to tag them, Vim could never know which one you mean when hitting
Ctrl-] on one of them: Vim tags are global; and BTW, gD is also supposed
to be global.


Best regards,
Tony.
--
Limericks are art forms complex,
Their topics run chiefly to sex.
        They usually have virgins,
        And masculine urgin's,
And other erotic effects.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: CTRL-] jumping for local variable

Woody Wu
On 9 May 2010 12:27, Tony Mechelynck <[hidden email]> wrote:

> On 09/05/10 05:57, Steven Woody wrote:
>>
>> Hi,
>>
>> When using ctags,  CTRL-] does not work for local declared variables,
>> in the case, I have to use gD to do the jumping.  Does this behavior
>> changeable? I hope I can always use CTRL-] and CTRL-T.
>>
>> Thanks.
>>
>
> I think it's intentional. Let's say you have a lot of functions all over
> your code with in each of them a local loop counter named i -- if ctags were
> to tag them, Vim could never know which one you mean when hitting Ctrl-] on
> one of them: Vim tags are global; and BTW, gD is also supposed to be global.
>

It sounds reasonable.  But, how about when a user type CTRL-] and not
tag found for it, then vim automatically use gD to do the jumping?
And, in this case, CTRL-T also bring the user back.  If so, the local
variables don't need to be in the tags database.   Can vim do it?
Thanks.

--
Life is the only flaw in an otherwise perfect nonexistence
    -- Schopenhauer

narke
public key at http://subkeys.pgp.net:11371 ([hidden email])

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: CTRL-] jumping for local variable

Tony Mechelynck
On 09/05/10 11:46, Steven Woody wrote:

> On 9 May 2010 12:27, Tony Mechelynck<[hidden email]>  wrote:
>> On 09/05/10 05:57, Steven Woody wrote:
>>>
>>> Hi,
>>>
>>> When using ctags,  CTRL-] does not work for local declared variables,
>>> in the case, I have to use gD to do the jumping.  Does this behavior
>>> changeable? I hope I can always use CTRL-] and CTRL-T.
>>>
>>> Thanks.
>>>
>>
>> I think it's intentional. Let's say you have a lot of functions all over
>> your code with in each of them a local loop counter named i -- if ctags were
>> to tag them, Vim could never know which one you mean when hitting Ctrl-] on
>> one of them: Vim tags are global; and BTW, gD is also supposed to be global.
>>
>
> It sounds reasonable.  But, how about when a user type CTRL-] and not
> tag found for it, then vim automatically use gD to do the jumping?
> And, in this case, CTRL-T also bring the user back.  If so, the local
> variables don't need to be in the tags database.   Can vim do it?
> Thanks.
>

I don't know (but I wouldn't bet on it).


Best regards,
Tony.
--
DEAD PERSON:  I don't want to go in the cart!
CUSTOMER:     Oh, don't be such a baby.
MORTICIAN:    I can't take him...
DEAD PERSON:  I feel fine!
CUSTOMER:     Oh, do us a favor...
MORTICIAN:    I can't.
                                   The Quest for the Holy Grail (Monty
Python)

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php