What is the short-cut key to jump to declaration in Emacs?

前端 未结 4 1261
误落风尘
误落风尘 2021-01-31 03:18

In visual studio it \'s easier to push F12 button to jump to a declaration of a function or variable when editing C/C++ code.

Is there a short-cut key in emacs to do th

4条回答
  •  半阙折子戏
    2021-01-31 04:12

    There are multiple ways to do this. As darioo mentioned, Ctags is one, but it goes to the definition by default (which might work for you). Looking further, though, you can see that prefixing M-.(ie, C-u M-.) will take you to the next tag match (which is often the declaration). There is also a --declarations option, but Exuberant Ctags doesn't seem to support it.

    CEDET is another option, but in my experience, it's still not ready for production. Often times in C++ semantic-ia-fast-jump will go to forward declarations instead of the definition or the declaration.

提交回复
热议问题