如何告诉emacs以C ++模式打开.h文件? [英] How to tell emacs to open .h file in C++ mode?

查看:100
本文介绍了如何告诉emacs以C ++模式打开.h文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我应该在_emacs(在Windows上)文件中添加哪些行以使其以C ++模式打开.h文件?默认为C模式。

解决方案

尝试这样:

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

无论何时打开.h文件,将使用C ++模式。


What lines should I add to my _emacs (on Windows) file to have it open .h files in C++ mode? The default is C mode.

解决方案

Try this:

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

Whenever you open .h files, C++-mode will be used.

这篇关于如何告诉emacs以C ++模式打开.h文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆