vim can't use paths in tags file, exuberant ctags [win xp] on c

438 views
Skip to first unread message

Robert Mark Bram

unread,
Jul 24, 2009, 3:34:50 AM7/24/09
to vim_use
Hi All,

I am a bit confused. Using Exuberant Ctags I can generate tags files
for Java source, but the paths are generated as Windows paths, which
vim on Cygwin doesn't understand (of course).

How do I generate tags files that Cygwin will understand?

I installed Exuberant Ctags "Source and binary for Windows 98/NT/2000/
XP" and put in my Cygwin path..

I ran the tags commands (it only worked using Windows paths).
ctags -V -f 'c:\rob\cygHome\.tags' --language-force=java -R 'C:\rob
\work\projects\nd\ford\tp07\rtb\src\java'
ctags -V -a -f 'c:\rob\cygHome\.tags' --language-force=java -R 'C:\rob
\apps\java\jdksrc\jdk6.14'

I added this line to .vimrc:
autocmd FileType java set tags=~/.tags

I see the windows paths in .tags:
ParseException
C:\rob\apps\java\jdksrc\jdk6.14\com\sun\jmx\snmp\IPAcl
\ParseException.java /^
public ParseException(String message) {$/;" m class:ParseException

And the in vim on Cygwin, it can't find the files when I use control
+};
tag 1 of 8 or more
File
"/c/rob/cygHome/C:\rob\apps\java\jdksrc\jdk6.14\com\sun\jmx\snmp\IPAcl
\ParseExce\
ption.java" does not exist

I thought maybe I should use the ctags that comes with Cygwin.. but
that does nothing
Fri Jul 24 - 12:43 PM > /usr/bin/ctags -V -f ~/.tags --language-
force=java -R
/rob/apps/java/jdksrc/jdk6.14
ctags (standalone 21.4.22)
Copyright (C) 2007 Free Software Foundation, Inc.
This program is distributed under the terms in ETAGS.README

Any assistance would be much appreciated!

Rob
:)

Alessandro Antonello

unread,
Jul 24, 2009, 12:10:01 PM7/24/09
to vim...@googlegroups.com
Hi, Bram.

>
> I am a bit confused. Using Exuberant Ctags I can generate tags files
> for Java source, but the paths are generated as Windows paths, which
> vim on Cygwin doesn't understand (of course).
>
> How do I generate tags files that Cygwin will understand?
>
> I installed Exuberant Ctags "Source and binary for Windows 98/NT/2000/
> XP" and put in my Cygwin path..

Well, you can install a lot of tools on Cygwin and call then in a Windows
prompt. I use this a lot. But you must be very careful using a Windows tool
on Cygwin. At all, you should avoid do that.

If you are using Vim on Cygwin you should install Exuberant CTags on Cygwin.
This will work as expected.

I use Vim and GVim on Windows and use Exuberant CTags on Windows. Works fine.
I use CScope installed on my Cygwin package, from a windows prompt. Also
works fine. I use "ls", "d (the directory listing tool)", "man", "info" and
all others tools in the Cygwin package from a Windows shell. All works fine
for me. I have Python and Perl installed on Cygwin and use the scripts from
the Windows shell. Also all works fine. In this case I had to do a little
batch script to call the ".py" or ".pl" files using Python or Perl. Too easy.

Off course the "\cygwin\bin" directory is on my Windows PATH environment
variable.

Best Regards,
Alessandro

Tom

unread,
Jul 25, 2009, 12:36:36 AM7/25/09
to vim_use
> I ran the tags commands (it only worked using Windows paths).
> ctags -V -f 'c:\rob\cygHome\.tags' --language-force=java -R 'C:\rob
> \work\projects\nd\ford\tp07\rtb\src\java'
> ctags -V -a -f 'c:\rob\cygHome\.tags' --language-force=java -R 'C:\rob
> \apps\java\jdksrc\jdk6.14'

The cygwin version of ctags produces filenames with slashes. If you
use only relative paths, i.e. if you run the ctags command from the
projects' top directory and save the tags file there, you get tags
file that should be useable with windows gvim & cygwin. You can use
multiple tags files in vim.

Robert Mark Bram

unread,
Jul 26, 2009, 9:22:09 PM7/26/09
to vim_use
Thank you Tom,
With this in mind, I re-ran my tags commands (from Cygwin) in the
following way, to ensure the tags files get created in the same
directory that the source files are within:
cd 'C:\rob\apps\java\jdksrc\jdk6.14'
ctags -V -a -f '.tags' --language-force=java -R
cd 'C:\rob\work\projects\nd\ford\tp07\rtb\src\java'
ctags -V -f '.tags' --language-force=java -R

And then added the following to my .vimrc, using Cygwin paths
(symbolic links I had made):
autocmd FileType java set tags=/apps/java/jdksrc/jdk6.14/.tags,/wd/src/
java/.tags

Now my tags work nicely - thank you very much!

Rob
:)
Reply all
Reply to author
Forward
0 new messages