How to tell emacs to open .h file in C++ mode?

后端 未结 6 1638
暗喜
暗喜 2020-11-29 03:28

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.

6条回答
  •  时光说笑
    2020-11-29 03:40

    Try this:

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

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

提交回复
热议问题