Any program or trick to find the definition of a variable?

前端 未结 8 1068
梦谈多话
梦谈多话 2021-01-02 09:01

Many times when I am watching others code I just want to find where and how a variable is defined. Normally what I do now is look for the type of the variable until I find t

8条回答
  •  失恋的感觉
    2021-01-02 09:35

    I use cscope and ctags-exuberant religiously. Run it once on my code base and then in Vim, I can use various commands like ^] or [D or [I or similar to find any definitions or declarations for a given word.

    This is similar to facilities provided by mega-IDEs like Visual Studio and Eclipse.

    Cscope also functions as a stand-alone tool that performs these searches.

提交回复
热议问题