【问题标题】:open include files in emacs as you can in msvc (visual c++)像在 msvc 中一样在 emacs 中打开包含文件(visual c++)
【发布时间】:2013-04-07 05:59:35
【问题描述】:

MSVC visual c++ 允许您右键单击#include 指令头文件 (.h) 并选择“打开文档”。 这使得浏览源代码变得轻而易举,因为它将整个源代码树基本上变成了一个超链接网站。 emacs 是否提供这种便利?是否有其他设备可以自动浏览源代码、您编写的任何代码、创建任何项目? Xcode 有吗?日食吗?有什么事吗?

【问题讨论】:

    标签: visual-c++ emacs ide include


    【解决方案1】:

    C-c C-o,运行命令ff-find-other-file,就是你要找的。当点位于#include 行时,它将打开包含的文件。

    搜索emacs code browsing 也会显示

    【讨论】:

    • 是的。 Xcode 有开放的“被调用者/调用者”,vim 有一个叫做键入 gd 的东西,但 cedet 适用于它。并且 Eclipse 具有“开放声明”,而 code::blocks 具有“开放头文件”。我认为 MSVC 和 windows 会被点击进入垃圾箱。
    【解决方案2】:

    可以使用semantic Smart Jump,将光标移动到#include行,然后执行命令semantic-ia-fast-jump,该命令一般用于跳转到符号,也可以跳转到包含文件。

    作为使用semantic-ia-fast-jump 的前提条件,您需要在ede project 中管理您的代码,这里是C/C++ 项目的示例

    假设你的目录结构是这样的:

    ~/myproject/
      |-include/test.h
      |-src/test.c
      |-Makefile
    

    和你的ede项目配置

    (ede-cpp-root-project "MyProject"
        :file "~/myproject/Makefile"
        :include-path '( "/include" )
        :system-include-path '( "/usr/include/mysql/" )
    

    test.c

    #include <mysql.h>
    #include "test.h"
    

    现在,将光标移动到 test.c 中的两行之一,运行 semantic-ia-fast-jump

    【讨论】:

      猜你喜欢
      • 2012-07-27
      • 2012-11-18
      • 1970-01-01
      • 2020-02-21
      • 1970-01-01
      • 2019-01-28
      • 1970-01-01
      • 2019-07-23
      • 2012-06-23
      相关资源
      最近更新 更多