Copyright (C) 2010-2018 Aidan Thompson <athomps at sandia.gov>
Copyright (C) 2018 Rohit Goswami <r95g10 at gmail.com>
A major mode based off shell-script-mode
for basic syntax highlighting of
lammps files.
Updated and kept here for MELPA usage.
A copy of the latest version is also available at the lammps github repo, under
the tool/emacs
folder.
Requirements: GNU Emacs 24.*
The easiest installation method is via MELPA and it is advisable to use one of the many MELPA installation methods.
For example, with use-package one can simply use the following:
(use-package lammps-mode)
Assuming for some reason you have downloaded the file to
~/.emacs.d/lisp
you would do the following (kanged
from
here):
;; Tell emacs where is your personal elisp lib dir
(add-to-list 'load-path "~/.emacs.d/lisp/")
;; load the package.
(load "lammps-mode")
To automatically turn on the LAMMPS mode for editing your input scripts, use the following line as the first line of your script:
# -*- lammps -*-
For automatically switching on the LAMMPS mode based on filename
patterns, e.g. for in.*
and *.lmp
files, add the following code to
your .emacs
:
(autoload 'lammps-mode "lammps-mode.el" "LAMMPS mode." t)
(setq auto-mode-alist (append auto-mode-alist
'(("in\\." . lammps-mode))
'(("\\.lmp\\'" . lammps-mode))
))
By far not all commands are included in the syntax file (lammps-mode.el). You can easily add new ones to the existing classes.
lammps-mode
is derived from shell-script-mode
which provides some
basic syntax highlighting of strings, comments, etc.
The MELPA recipe used for this package is simply:
(lammps-mode :fetcher github :repo "HaoZeke/lammps-mode")
- Does not work with Xemacs [See this comment]
GNU GPL v2. Check the file for more details.