CafeMol-mode in Emacs.

Source code deployed on Github.


To use this mode for writing or editing CafeMol input file, add the following to your Emacs configuration file:

(add-to-list 'load-path "~/path_to_cafemol-mode/")
(require 'cafemol-mode)
(add-to-list 'auto-mode-alist '("\\.inp\\'" . cafemol-mode))

To use the snippets, please try this:


  • provide a major mode for CafeMol input files
  • key words highlighting
  • comment (*) recognition; use Alt+; to comment out selected region
  • indentation
  • section fold
  • snippet
  • other…


This file is derived from Emacs DerivedMode:

As for syntax highlighting, the codes are modified from Xah Lee’s tutorial (ergoemacs):