does VIM read OK the tags file if ctags was installed after VIM?

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

does VIM read OK the tags file if ctags was installed after VIM?

Jose Caballero
Hi,

I am working on a host that didn't have ctags installed. I have just
installed it.
However, I think I am missing some step.
After creating the tags file, opening a file with VIM and hitting
CTRL+] on a string, it does not jump to the file with the definition.
It just gives me a comment like

         "tag 1 of 20 or more"

It is not a problem with the path, as I do first

         :set path+=**

Same tree directory on a different host with same version of VIM, but
ctags installed, works fine. CTRL+] gives me a list of options from
the tags files, asking me to type the number (index) I want.

Any hint? What are the key words I should use to search for the
solution myself in google or the :help?


Thanks a lot in advance,
Jose

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: does VIM read OK the tags file if ctags was installed after VIM?

Erik Christiansen
On 14.08.17 19:23, Jose Caballero wrote:
> I am working on a host that didn't have ctags installed. I have just
> installed it.

The install order won't make any difference. Vim only needs to find a
tags file you've generated.

> However, I think I am missing some step.
> After creating the tags file, opening a file with VIM and hitting
> CTRL+] on a string, it does not jump to the file with the definition.
> It just gives me a comment like
>
>          "tag 1 of 20 or more"

I've never seen that response, so can only offer general ideas, based on
what has always worked for me.

> It is not a problem with the path, as I do first
>
>          :set path+=**
>
> Same tree directory on a different host with same version of VIM, but
> ctags installed, works fine. CTRL+] gives me a list of options from
> the tags files, asking me to type the number (index) I want.

As it's the same directory structure, what happens if you copy the tags
file over, instead of generating it? (Oh, **, multiple tag files. Even
so.) Alternatively, install the new ctags on the working host, in a
different path, and use it to overwrite the working tags files, if
that's quicker.

Are the ctags executables identical? (I've tended to use "exhuberant
ctags", though the choice was made so many decades ago that I can't
recall the basis. The plain version wasn't as appealing, though.)

> Any hint? What are the key words I should use to search for the
> solution myself in google or the :help?

It sounds to me like the uncooperative response has to be due to
different tags files, as the Vim instances are identical.

Limited help, I'm afraid, but it's assumption-testing time. ;-)

Erik

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: does VIM read OK the tags file if ctags was installed after VIM?

Benjamin Fritz
In reply to this post by Jose Caballero
On Monday, August 14, 2017 at 6:23:22 PM UTC-5, Jose Caballero wrote:
> It is not a problem with the path, as I do first
>
>          :set path+=**
>

'path' option should not matter. What is your 'tags' option set to? Is it finding the tags file you expect (and only the tags file you expect)?

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: does VIM read OK the tags file if ctags was installed after VIM?

Jose Caballero
Thanks Ben and Erik.

Both tags files are identical:

    host1 $ md5sum tags
    34e5413f4dea1c0644b35de7808a8029  tags

    host2 $ mad5sum tags
    34e5413f4dea1c0644b35de7808a8029  tags

Also tags are equal:

   :set tags?
    tags=./tags,./TAGS,tags,TAGS


But, when hitting CTRL+] on top of a tag....

    @ host1 I get the expected

   # pri kind tag                 file
      1 F C i    StatusInterface  plugins/status/Plugin.py
                   from interfaces import StatusInterface
      2 F   c    StatusInterface  interfaces.py
                   class StatusInterface(object):


    @ host 2, I get something like "tag 1 of 2 or more", and that's it.

Both host have VIM 7.4.160

Huh?

Cheers,
Jose

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: does VIM read OK the tags file if ctags was installed after VIM?

Benji Fisher-3
On Tue, Aug 15, 2017 at 4:42 PM, Jose Caballero <[hidden email]> wrote:
Thanks Ben and Erik.

Both tags files are identical:

    host1 $ md5sum tags
    34e5413f4dea1c0644b35de7808a8029  tags

    host2 $ mad5sum tags
    34e5413f4dea1c0644b35de7808a8029  tags

Also tags are equal:

   :set tags?
    tags=./tags,./TAGS,tags,TAGS


But, when hitting CTRL+] on top of a tag....

    @ host1 I get the expected

   # pri kind tag                 file
      1 F C i    StatusInterface  plugins/status/Plugin.py
                   from interfaces import StatusInterface
      2 F   c    StatusInterface  interfaces.py
                   class StatusInterface(object):


    @ host 2, I get something like "tag 1 of 2 or more", and that's it.

Both host have VIM 7.4.160

Huh?

Cheers,
Jose

That seems odd.  I think that my first suggestions would have been the same as Ben and Erik's.

Does :ts help clarify the situation?

:help :tselect

It seems that the message about the number of tags only shows up if there is no other message.  Often, a tag command takes you to a new file, so you get a message about entering that file instead.  See

:help tag-matchlist

and scroll past the various commands, or :help :ltag and scroll just a little bit.

When there is no other message, Vim shows which matching tag has been jumped
to, and the number of matching tags: >
tag 1 of 3 or more
The " or more" is used to indicate that Vim didn't try all the tags files yet.
When using ":tnext" a few times, or with ":tlast", more matches may be found.
When you didn't see this message because of some other message, or you just
want to know where you are, this command will show it again (and jump to the
same tag as last time): >
:0tn

HTH
-- 
Benji Fisher

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: does VIM read OK the tags file if ctags was installed after VIM?

Jose Caballero
2017-08-15 17:44 GMT-04:00 Benji Fisher <[hidden email]>:

> On Tue, Aug 15, 2017 at 4:42 PM, Jose Caballero <[hidden email]>
> wrote:
>>
>> Thanks Ben and Erik.
>>
>> Both tags files are identical:
>>
>>     host1 $ md5sum tags
>>     34e5413f4dea1c0644b35de7808a8029  tags
>>
>>     host2 $ mad5sum tags
>>     34e5413f4dea1c0644b35de7808a8029  tags
>>
>> Also tags are equal:
>>
>>    :set tags?
>>     tags=./tags,./TAGS,tags,TAGS
>>
>>
>> But, when hitting CTRL+] on top of a tag....
>>
>>     @ host1 I get the expected
>>
>>    # pri kind tag                 file
>>       1 F C i    StatusInterface  plugins/status/Plugin.py
>>                    from interfaces import StatusInterface
>>       2 F   c    StatusInterface  interfaces.py
>>                    class StatusInterface(object):
>>
>>
>>     @ host 2, I get something like "tag 1 of 2 or more", and that's it.
>>
>> Both host have VIM 7.4.160
>>
>> Huh?
>>
>> Cheers,
>> Jose
>
>
> That seems odd.  I think that my first suggestions would have been the same
> as Ben and Erik's.
>
> Does :ts help clarify the situation?
>


hmmm.
That is interesting.
In both cases, after trying a tag, :ts gives me the same, similar to

   # pri kind tag                 file
      1 F C i    StatusInterface  plugins/status/Plugin.py
                   from interfaces import StatusInterface
      2 F   c    StatusInterface  interfaces.py
                   class StatusInterface(object):

And, indeed, typing the number opens the right file, as it was
supposed to work with CTRL+]

It is like the actual command CTRL+] is the one that is not working in
one of the hosts, but the tags information has been read by VIM and
it's reachable via :ts

Cheers,
Jose

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: does VIM read OK the tags file if ctags was installed after VIM?

Gary Johnson-4
On 2017-08-17, Jose Caballero wrote:

> In both cases, after trying a tag, :ts gives me the same, similar to
>
>    # pri kind tag                 file
>       1 F C i    StatusInterface  plugins/status/Plugin.py
>                    from interfaces import StatusInterface
>       2 F   c    StatusInterface  interfaces.py
>                    class StatusInterface(object):
>
> And, indeed, typing the number opens the right file, as it was
> supposed to work with CTRL+]
>
> It is like the actual command CTRL+] is the one that is not working in
> one of the hosts, but the tags information has been read by VIM and
> it's reachable via :ts

You could execute

    :verbose map <C-]>

where those are all printable characters and not a literal CTRL-],
to see if there is a mapping for CTRL-] and if it exists, where it
is defined.

Regards,
Gary

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: does VIM read OK the tags file if ctags was installed after VIM?

Jose Caballero
2017-08-17 14:51 GMT-04:00 Gary Johnson <[hidden email]>:

> On 2017-08-17, Jose Caballero wrote:
>
>> In both cases, after trying a tag, :ts gives me the same, similar to
>>
>>    # pri kind tag                 file
>>       1 F C i    StatusInterface  plugins/status/Plugin.py
>>                    from interfaces import StatusInterface
>>       2 F   c    StatusInterface  interfaces.py
>>                    class StatusInterface(object):
>>
>> And, indeed, typing the number opens the right file, as it was
>> supposed to work with CTRL+]
>>
>> It is like the actual command CTRL+] is the one that is not working in
>> one of the hosts, but the tags information has been read by VIM and
>> it's reachable via :ts
>
> You could execute
>
>     :verbose map <C-]>
>
> where those are all printable characters and not a literal CTRL-],
> to see if there is a mapping for CTRL-] and if it exists, where it
> is defined.
>
> Regards,
> Gary
>

Thanks for the tip.
At this point, I need to do a little bit of googling, as I am not sure
how to interpret the results.

:verbose map <C-]>
No mapping found

:nmap
n  [m          *@:call <SNR>22_Python_jump('?^\s*\(class\|def\)')<CR>
n  [[          *@:call <SNR>22_Python_jump('?^\(class\|def\)')<CR>
n  ]m          *@:call <SNR>22_Python_jump('/^\s*\(class\|def\)')<CR>
n  ]]          *@:call <SNR>22_Python_jump('/^\(class\|def\)')<CR>
n  gx            <Plug>NetrwBrowseX
n  <Plug>NetrwBrowseX * :call netrw#NetrwBrowseX(expand("<cWORD>"),0)<CR>


Here the problem is simply my lack of knowledge, I have homework to do.
Thanks anyways to everyone for your time and tips.

Cheers,
Jose

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: does VIM read OK the tags file if ctags was installed after VIM?

Nikolay Aleksandrovich Pavlov
2017-08-17 22:04 GMT+03:00 Jose Caballero <[hidden email]>:

> 2017-08-17 14:51 GMT-04:00 Gary Johnson <[hidden email]>:
>> On 2017-08-17, Jose Caballero wrote:
>>
>>> In both cases, after trying a tag, :ts gives me the same, similar to
>>>
>>>    # pri kind tag                 file
>>>       1 F C i    StatusInterface  plugins/status/Plugin.py
>>>                    from interfaces import StatusInterface
>>>       2 F   c    StatusInterface  interfaces.py
>>>                    class StatusInterface(object):
>>>
>>> And, indeed, typing the number opens the right file, as it was
>>> supposed to work with CTRL+]
>>>
>>> It is like the actual command CTRL+] is the one that is not working in
>>> one of the hosts, but the tags information has been read by VIM and
>>> it's reachable via :ts
>>
>> You could execute
>>
>>     :verbose map <C-]>
>>
>> where those are all printable characters and not a literal CTRL-],
>> to see if there is a mapping for CTRL-] and if it exists, where it
>> is defined.
>>
>> Regards,
>> Gary
>>
>
> Thanks for the tip.
> At this point, I need to do a little bit of googling, as I am not sure
> how to interpret the results.
>
> :verbose map <C-]>
> No mapping found
>
> :nmap
> n  [m          *@:call <SNR>22_Python_jump('?^\s*\(class\|def\)')<CR>
> n  [[          *@:call <SNR>22_Python_jump('?^\(class\|def\)')<CR>
> n  ]m          *@:call <SNR>22_Python_jump('/^\s*\(class\|def\)')<CR>
> n  ]]          *@:call <SNR>22_Python_jump('/^\(class\|def\)')<CR>
> n  gx            <Plug>NetrwBrowseX
> n  <Plug>NetrwBrowseX * :call netrw#NetrwBrowseX(expand("<cWORD>"),0)<CR>
>
>
> Here the problem is simply my lack of knowledge, I have homework to do.
> Thanks anyways to everyone for your time and tips.
>
> Cheers,
> Jose

One of the other things which may affect <C-]> is &iskeyword setting:
check `:verbose set iskeyword?`. Note that &iskeyword setting is
likely to be the culprint if presence of certain non-alphanumeric
characters (e.g. underscore) makes tag not possible to find: any sane
configuration for non-esoteric languages will include a-zA-Z0-9 in
&iskeyword.

>
> --
> --
> 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
>
> ---
> You received this message because you are subscribed to the Google Groups "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
> For more options, visit https://groups.google.com/d/optout.

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: does VIM read OK the tags file if ctags was installed after VIM?

Jose Caballero
2017-08-17 16:15 GMT-04:00 Nikolay Aleksandrovich Pavlov <[hidden email]>:

> 2017-08-17 22:04 GMT+03:00 Jose Caballero <[hidden email]>:
>> 2017-08-17 14:51 GMT-04:00 Gary Johnson <[hidden email]>:
>>> On 2017-08-17, Jose Caballero wrote:
>>>
>>>> In both cases, after trying a tag, :ts gives me the same, similar to
>>>>
>>>>    # pri kind tag                 file
>>>>       1 F C i    StatusInterface  plugins/status/Plugin.py
>>>>                    from interfaces import StatusInterface
>>>>       2 F   c    StatusInterface  interfaces.py
>>>>                    class StatusInterface(object):
>>>>
>>>> And, indeed, typing the number opens the right file, as it was
>>>> supposed to work with CTRL+]
>>>>
>>>> It is like the actual command CTRL+] is the one that is not working in
>>>> one of the hosts, but the tags information has been read by VIM and
>>>> it's reachable via :ts
>>>
>>> You could execute
>>>
>>>     :verbose map <C-]>
>>>
>>> where those are all printable characters and not a literal CTRL-],
>>> to see if there is a mapping for CTRL-] and if it exists, where it
>>> is defined.
>>>
>>> Regards,
>>> Gary
>>>
>>
>> Thanks for the tip.
>> At this point, I need to do a little bit of googling, as I am not sure
>> how to interpret the results.
>>
>> :verbose map <C-]>
>> No mapping found
>>
>> :nmap
>> n  [m          *@:call <SNR>22_Python_jump('?^\s*\(class\|def\)')<CR>
>> n  [[          *@:call <SNR>22_Python_jump('?^\(class\|def\)')<CR>
>> n  ]m          *@:call <SNR>22_Python_jump('/^\s*\(class\|def\)')<CR>
>> n  ]]          *@:call <SNR>22_Python_jump('/^\(class\|def\)')<CR>
>> n  gx            <Plug>NetrwBrowseX
>> n  <Plug>NetrwBrowseX * :call netrw#NetrwBrowseX(expand("<cWORD>"),0)<CR>
>>
>>
>> Here the problem is simply my lack of knowledge, I have homework to do.
>> Thanks anyways to everyone for your time and tips.
>>
>> Cheers,
>> Jose
>
> One of the other things which may affect <C-]> is &iskeyword setting:
> check `:verbose set iskeyword?`. Note that &iskeyword setting is
> likely to be the culprint if presence of certain non-alphanumeric
> characters (e.g. underscore) makes tag not possible to find: any sane
> configuration for non-esoteric languages will include a-zA-Z0-9 in
> &iskeyword.
>


In both cases

:verbose set iskeword?
iskeyword=@,48-57,_,192-255

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: does VIM read OK the tags file if ctags was installed after VIM?

Benji Fisher-3
On Thu, Aug 17, 2017 at 6:02 PM, Jose Caballero <[hidden email]> wrote:
2017-08-17 16:15 GMT-04:00 Nikolay Aleksandrovich Pavlov <[hidden email]>:
> 2017-08-17 22:04 GMT+03:00 Jose Caballero <[hidden email]>:
>> 2017-08-17 14:51 GMT-04:00 Gary Johnson <[hidden email]>:
>>> On 2017-08-17, Jose Caballero wrote:
>>>
>>>> In both cases, after trying a tag, :ts gives me the same, similar to
>>>>
>>>>    # pri kind tag                 file
>>>>       1 F C i    StatusInterface  plugins/status/Plugin.py
>>>>                    from interfaces import StatusInterface
>>>>       2 F   c    StatusInterface  interfaces.py
>>>>                    class StatusInterface(object):
>>>>
>>>> And, indeed, typing the number opens the right file, as it was
>>>> supposed to work with CTRL+]
>>>>
>>>> It is like the actual command CTRL+] is the one that is not working in
>>>> one of the hosts, but the tags information has been read by VIM and
>>>> it's reachable via :ts

Wait a minute.   I missed something here.

The results of :ts look reasonable, except that I would expect one row (probably the first) to be marked with ">" to the left of the "#" column.

Are you expecting to see the same thing from <C-]> (that is, CTRL-])?  If the cursor is on the word "StatusInterface", then <C-]> should work the same as ":tag StatusInterface", jumping to the line specified in the tags file.  It does not normally show the list of matching tags (like :ts).  If <C-]> is mapped to something non-standard, it is non-standard on the first host, not the second.

:help :tag
:help :tselect

HTH
-- 
Benji Fisher

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.