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

时间:2010-08-21 01:44:26

标签: emacs

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

我在fedura6中使用emacs23.2。

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

2 个答案:

答案 0 :(得分:3)

(setq auto-mode-alist (cons '("\\.h$" . c++-mode) auto-mode-alist))

答案 1 :(得分:3)

这可能会更美观吗?

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