Monday, April 11, 2011

nagios-mode for Emacs

Thanks for nagios-mode.el, Michael Orlitzky! Here's how I achieved syntax highlighting-induced joy for Nagios config files in XEmacs Instant Classic (if you have to ask, you don't deserve to know ;).
  1. Browse to http://michael.orlitzky.com/git/?p=nagios-mode.git;a=blob_plain;f=nagios-mode.el;hb=HEAD
  2. Save file to something like ~/.xemacs/user_lisp/nagios-mode.el
  3. If you haven't already included ~/.xemacs/user_lisp in your load path, do so now by adding the following to your ~/.xemacs/custom.el:
    (add-to-list 'load-path "$HOME/.xemacs/user_lisp/")
  4. Now, load nagios-mode.el by adding the following to your ~/.xemacs/custom.el:
    (autoload 'nagios-mode "$HOME/.xemacs/user_lisp/nagios-mode.el"
    "Major mode for editing Nagios config files" t)
  5. Finally, you'll want nagios-mode.el automatically enabled for Nagios config files, so add the following to your ~/.xemacs/custom.el:
    ; nagios-mode
    (add-to-list 'auto-mode-alist
    '("nagios-config/objects/.+\\.cfg$" . nagios-mode))

You're welcome. ;)

No comments: