has anyone had a problem with taglist on macvim?

134 views
Skip to first unread message

vivacarlie

unread,
Nov 14, 2007, 1:50:26 PM11/14/07
to vim_mac
I can get that there is an error with taglist but it won't tell me
what the error is. so I don't know how to diagnose it. I just wonder
if anyone is getting an error that keeps taglist from displaying and
only giving a window.

björn

unread,
Nov 16, 2007, 10:11:58 AM11/16/07
to vim...@googlegroups.com

I'm sorry, but I don't at all understand what your problem is (and
from the lack of responses I am guessing nobody else does either).
Can you try to clarify what your problem is so that maybe we can help
you out? Could you perhaps tell us what steps to take in order to
reproduce the problem?


/Björn

imick

unread,
Nov 25, 2007, 12:39:43 PM11/25/07
to vim_mac
Hi, Björn,

I had the same problem too. The problem is Taglist under Cocoa-Vim
doesn't work. I tried it with the older Mac Vim port (I assume that
one is Carbon-based), it works on that version. Did you personally use
Taglist.vim? Could you help us to look at it?

My environment:
OS X Leopard, MacVim(snapshot-0711A), Vim.app(as a comparison)

I took a screen capture with the problem:

http://www.divshare.com/download/2885291-e37

Left one is Vim.app, right is MacVim, both open a same source and with
Taglist window open. You can see Vim.app showed the taglist correctly
while MacVim could only show the program's name (tags file created
beforehand, no problem there). Hope this information could help.

Thank you in advance.
imick

On 11月16日, 上午10时11分, "björn" <bjorn.winck...@gmail.com> wrote:

björn

unread,
Nov 25, 2007, 3:47:22 PM11/25/07
to vim...@googlegroups.com
On 25/11/2007, imick <imi...@gmail.com> wrote:
>
> I had the same problem too. The problem is Taglist under Cocoa-Vim
> doesn't work. I tried it with the older Mac Vim port (I assume that
> one is Carbon-based), it works on that version. Did you personally use
> Taglist.vim? Could you help us to look at it?
>
> My environment:
> OS X Leopard, MacVim(snapshot-0711A), Vim.app(as a comparison)
>
> I took a screen capture with the problem:
>
> http://www.divshare.com/download/2885291-e37
>
> Left one is Vim.app, right is MacVim, both open a same source and with
> Taglist window open. You can see Vim.app showed the taglist correctly
> while MacVim could only show the program's name (tags file created
> beforehand, no problem there). Hope this information could help.

Thanks for clarifying this for me a bit. I installed taglist.vim but
I do not know how to use it, so please give me step-by-step
information what I have to do to recreate these problems. I
understand you have to use ctags, but I've basically never used that
program either so the more detail you can provide, the better.

Thanks,
Björn

imick

unread,
Nov 25, 2007, 7:22:49 PM11/25/07
to vim_mac
Hi, Björn,

Thank you for the prompt reply.

Ctags is a tool to create tags for variables, functions, subroutines
for the source. And taglist.vim can integrate this tool into vim. With
it, you can jump to the any function more quickly (like using helptags
for vim's documentation).

Now it is a simple guide of using it (didn't touch the advance
features, just the way I am using it):

1) http://ctags.sourceforge.net/
Please be noted, there are ctags and exuberant ctags. The upper link
is for exuberant ctags (they use ctags for the name, I guess it is
because they want to replace original ctags). Taglist.vim only
supports exuberant ctags. It seems the one OSX has is the old ctags.
You can come to this page to download the source and compile it.
Verify it with $ ctags --version

2) http://www.vim.org/scripts/script.php?script_id=273
Download this plugin from vim.org. Put the plugin under the vim's
plugin folder.

3) Fire terminal.app, go into the folder of your source, simply type $
ctags -R * (this command will create tags for all the sources under
current folder)

4) Under vim, command mode, type ":TlistToggle", a new window with all
the tags will be shown. Press enter to jump, ctrl-w w to jump between
tag-window and source-window.

Hope this helps.
imick

Nico Weber

unread,
Nov 26, 2007, 1:30:52 AM11/26/07
to vim...@googlegroups.com
> 1) http://ctags.sourceforge.net/
> Please be noted, there are ctags and exuberant ctags.
> You can come to this page to download the source and compile it.

Or use MacPorts ;-)

> Verify it with $ ctags --version

If you don't want to put exuberant ctags in your path for some reason,
you can set 'Tlist_Ctags_Cmd' accordingly.

> 3) Fire terminal.app, go into the folder of your source, simply type $
> ctags -R * (this command will create tags for all the sources under
> current folder)

While this is useful in general (so that you can use <C-]> to jump to
function definitions), it's not required to use the plugin. Taglist
automatically calls ctags every now and then to regenerate the tag list.

> 4) Under vim, command mode, type ":TlistToggle", a new window with all
> the tags will be shown. Press enter to jump, ctrl-w w to jump between
> tag-window and source-window.

imho, the plugin is more useful with these settings in your _vimrc:

let Tlist_Use_Right_Window=1
let Tlist_Enable_Fold_Column=0
let Tlist_Show_One_File=1 " especially with this one
let Tlist_Compact_Format=1
set updatetime=1000


If you're looking at taglist anyways, there's a small colorscheme
problem with it: the macvim color scheme uses the same color to
highlight the current function in taglist as to highlight the current
match. I often search for a tag name in the taglist window; after that
I have to use `:noh` before I can make sense of the "current function
highlight" in taglist again. This is not a problem with other
colorschemes (e.g. inkpot).

Nico

Nico Weber

unread,
Nov 26, 2007, 2:52:22 AM11/26/07
to vim...@googlegroups.com
Hi,

> I had the same problem too. The problem is Taglist under Cocoa-Vim
> doesn't work. I tried it with the older Mac Vim port (I assume that
> one is Carbon-based), it works on that version. Did you personally use
> Taglist.vim? Could you help us to look at it?

I just had the idea that this might be related to MacVim not setting
your path as you'd expect. What happens if you do `:!which ctags` in
MacVim? Does it help if you do `let Tlist_Ctags_Cmd='/opt/local/bin/
ctags'` (adjust path to the output of `which ctags` in Terminal.app)
right after you launch MacVim?

>
Nico

imick

unread,
Nov 26, 2007, 10:44:53 AM11/26/07
to vim_mac
Hi, Nico,

Your tip is wonderful. It fixed the problem. Just as you thought,
MacVim didn't set the path as Terminal.app did.
ctags under Terminal.app points to the correct exuberant ctags, but
under MacVim it still points to the old ctags.
After adding `let Tlist_Ctags_Cmd='/usr/local/bin/ctags'` to .vimrc,
taglist is working fine, I am very happy.

Also, thank you for the tips on using taglist. Pretty useful!!

imick

björn

unread,
Nov 26, 2007, 1:53:03 PM11/26/07
to vim...@googlegroups.com
On 26/11/2007, imick <imi...@gmail.com> wrote:
>
> Your tip is wonderful. It fixed the problem. Just as you thought,
> MacVim didn't set the path as Terminal.app did.
> ctags under Terminal.app points to the correct exuberant ctags, but
> under MacVim it still points to the old ctags.
> After adding `let Tlist_Ctags_Cmd='/usr/local/bin/ctags'` to .vimrc,
> taglist is working fine, I am very happy.
>
> Also, thank you for the tips on using taglist. Pretty useful!!

I am glad the problem is solved. Another way to deal with path issues
is to open up a terminal and type

defaults write org.vim.MacVim MMLoginShell 1

However, it doesn't seem to work with all shells (works with the OS X
default shell though).


/Björn

vivacarlie

unread,
Nov 26, 2007, 2:34:42 PM11/26/07
to vim_mac
Thanks again, sorry but i've been a bit buisy to give a screenshot.
stupid me!
Reply all
Reply to author
Forward
0 new messages