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

Try this:

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

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

Leave a Comment