Skip to content

HaoZeke/lammps-mode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

LAMMPS Mode

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.

Table of Contents

Installation

Requirements: GNU Emacs 24.*

Obtaining the Package

MELPA

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)

Manually

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")

Autoloading & Auto-recognition

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))
                              ))

Status

By far not all commands are included in the syntax file (lammps-mode.el). You can easily add new ones to the existing classes.

Implementation Details

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")

Caveats

License

GNU GPL v2. Check the file for more details.