【问题标题】:How can I get into the C++mode automatically when open .h files? [duplicate]打开 .h 文件时如何自动进入 C++ 模式? [复制]
【发布时间】:2011-04-01 22:39:19
【问题描述】:

如何在打开 .h 文件时自动进入 C++ 模式?

我在 fedura6 中使用 emacs23.2。

我用 C-x C-f xxx.h 打开 .cpp 文件。

【问题讨论】:

    标签: emacs


    【解决方案1】:
    (setq auto-mode-alist (cons '("\\.h$" . c++-mode) auto-mode-alist))
    

    【讨论】:

      【解决方案2】:

      或许这在美学上会更好?

      (add-to-list 'auto-mode-alist (cons "\\.h\\'" 'c++-mode))
      

      【讨论】:

        猜你喜欢
        • 2011-03-19
        • 2015-10-07
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2023-03-14
        • 2013-06-24
        相关资源
        最近更新 更多