开发者

Using Ctags with Gvim on Windows

开发者 https://www.devze.com 2023-03-26 03:08 出处:网络
I\'m using gvim as my main \'IDE\' on windows 7 and I开发者_StackOverflow中文版 would like to use ctags to navigate through the code. I\'ve downloaded it and ran based on this tutorial: http://www.tec

I'm using gvim as my main 'IDE' on windows 7 and I开发者_StackOverflow中文版 would like to use ctags to navigate through the code. I've downloaded it and ran based on this tutorial: http://www.techrepublic.com/article/configure-vi-for-java-application-development/5054618

ctags -f ~/.tags -R ~/myprojects/src $JAVA_HOME/src

I've then setup my vimrc with...

set tags=~/.tags

However when I do Ctrl+] on a keyword, it says it can not find the file which the tag is defined in. Shows the correct path except it misses out c:\ from the start so vim can't load it.

How can get it to give me the correct path?

I'm using the latest version of gvim and ctags.

Thanks


FWITW, I'm not entirely sold on the concept of keeping my tags in one location. This part of the command call:

-f ~/.tags

Nor would I hard path to my current project. This part:

-R ~/myprojects/src

BTW, Windows doesn't have ~ so I don't think either of those would work (not sure if Vim will find ~, i.e. "home").

If I were you, I would cut my teeth on the simplest method until you get more comfortable with the Vim methods and ideals.

Easiest method:

  1. Always let Vim know the "Current Directory" (making the assumption that you are not launching Vim via the command prompt). When you open a file always set the current directory by issuing the following command from normal mode:

    :cd %:p:h
    
  2. Generate a tag file in the current directory with the following command (from normal mode).

    :!ctags -R .
    

Happy jumping.

0

精彩评论

暂无评论...
验证码 换一张
取 消