MacVim and CTAGS

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

MacVim and CTAGS

consiglieri

Hi

I'm trying to get ctags working with macvim. I have downloaded ctags
and compiled it and all seems fine.

Now I would like to generate a tag file but I'm kind of at a loss
( being the newbie that I am) of what files I should run ctag against.

I tried " ctags  -f ~/.tags $JAVA_HOME/src.jar"

and it generated a .tags file. But I'm not sure I should run it
against src.jar.

And when I try ctrl-] in vim nothing happens.

I have tried googling but have not found anything that deals with
macos-x and java.

It's very likely I'm missing something here or not uderstanding
something so I would very much appreciate any help that might be
available.

Thanks


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_mac" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: MacVim and CTAGS

Nico Weber-3

Hi,

> Now I would like to generate a tag file but I'm kind of at a loss
> ( being the newbie that I am) of what files I should run ctag against.
>
> I tried " ctags  -f ~/.tags $JAVA_HOME/src.jar"
>
> and it generated a .tags file. But I'm not sure I should run it
> against src.jar.

you run ctags against your .java files. It can't parse .class files  
(those are typically included in a jar). I usually run it like

     ctags --recurse=yes .

in the root directory of my project. Then launch vim from that  
directory and everything should Just Work.

Something else: If you want to use java completion (like in eclipse  
etc.), I recommend the javacomplete plugin by fang chen ( http://
www.vim.org/scripts/script.php?script_id=1785 ). But install it  
to .vim/autoload and .vim/doc instead of where the install  
instructions tell you. When you've installed it, you can use C-x C-o  
to complete System.out.pr to System.out.println for example.

HTH,
Nico


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_mac" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: MacVim and CTAGS

consiglieri

Hi

Thanks for the answer. I have installed javacomplete and it works fine
( even if I dont understand why it cant complete if I just type
"System. ")

But the thing that is bothering me is where is the java source on the
mac. Everywhere I read I read that you should unpack src.zip but I
cant find any src.zip on the mac. Yes I realize this is not vim
specific and I apologize for this, but I was hoping there was a user
here that could help me. I would like ctags to parse the source java
files so I can do source look up.

Thanks

On 11 Sep, 21:40, Nico Weber <[hidden email]> wrote:

> Hi,
>
> > Now I would like to generate a tag file but I'm kind of at a loss
> > ( being the newbie that I am) of what files I should run ctag against.
>
> > I tried " ctags  -f ~/.tags $JAVA_HOME/src.jar"
>
> > and it generated a .tags file. But I'm not sure I should run it
> > against src.jar.
>
> you run ctags against your .java files. It can't parse .class files  
> (those are typically included in a jar). I usually run it like
>
>      ctags --recurse=yes .
>
> in the root directory of my project. Then launch vim from that  
> directory and everything should Just Work.
>
> Something else: If you want to use java completion (like in eclipse  
> etc.), I recommend the javacomplete plugin by fang chen ( http://www.vim.org/scripts/script.php?script_id=1785). But install it  
> to .vim/autoload and .vim/doc instead of where the install  
> instructions tell you. When you've installed it, you can use C-x C-o  
> to complete System.out.pr to System.out.println for example.
>
> HTH,
> Nico


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_mac" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: MacVim and CTAGS

consiglieri


The answer my friend is as follows.

Copy the src.jar file to somewhere and rename it src.zip then unpack
it. Sometimes its to easy! :)




--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_mac" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: MacVim and CTAGS

Nico Weber-3
In reply to this post by consiglieri

> Thanks for the answer. I have installed javacomplete and it works fine
> ( even if I dont understand why it cant complete if I just type
> "System. ")

This is a bug with the current javacomplete script (which occurs  
because java on os x doesn't have one rt.jar, but two jars for the  
java runtime classes, classes.jar and ui.jar). Cheng fixed this, but  
hasn't released an updated version yet. I'm pretty sure it's going to  
work with the next release.

Nico

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_mac" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---