emacs c++缩进和颜色突出显示
当我在 Windows 上安装 emacs/xemacs 打开 cpp/h 文件时,没有出现缩进或颜色。您能否建议我需要在设置文件中执行哪些操作才能实现此目的? 谢谢
I am not getting indentation or colors when I open a cpp/h file with my emacs/xemacs installation on windows. Could you please advise what I need to do in my settings file to make this happen?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
auto-mode-alist
变量存储应与文件扩展名相关的调用模式。默认情况下,此变量配置为将c++-mode
与 cpp 文件关联。通过执行 Ch v auto-mode-alist RET 查看 auto-mode-alist 的内容。
您也可以尝试自己定义关联,如下所示:
另请注意,.h 文件默认被视为 C 文件,而不是 C++。
It's the
auto-mode-alist
variable that stores the modes that should be invoked in relation with the file extension. This variable is configured by default to associatec++-mode
to cpp files.See the content of auto-mode-alist by doing a C-h v auto-mode-alist RET.
You could also try to define the association by yourself like this :
Also note that .h files are by default considered C files, not C++.
您的文件是否有
cpp
或c
扩展名?请查看 emacs 常见问题解答
Do your files have a
cpp
orc
extension?Please have a look at emacs faq