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

后端 未结 6 1637
暗喜
暗喜 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:42

    Apparently you can also put this at the top of the file:

    // -*-c++-*-
    

    to tell Emacs it's a C++ file.

    I use this since I quite frequently end up on a vanilla Emacs and it works without configuring Emacs in any way.

提交回复
热议问题