Tree-Sitter LAMMPS
A tree-sitter parser for input scripts for the LAMMPS molecular dynamics simulations package.
Tree-sitter
Grammar: grammar.js
This file contains code that is transpiled to the parser. It is a DSL that is described in the tree-sitter docs
Queries queries/*.scm
These files describe how the tree should be read and allows for syntax highlighting
Using with Neovim
-
Install nvim-treesitter plugin to Neovim
-
Add the following to your
init.luato define lammps file types:-- LAMMPS File type vim.. -
Add the following to your
init.luato tell tree-sitter how to access this parser:local parser_config = require. parser_config. = vim... -
run
:TSInstallFromGrammar lammpsto install the tree-sitter grammar. -
Copy the files from
queriesin this repo to a folderqueries/lammpsin the same directory as yourinit.lua -
Presto! Your LAMMPS input scripts should now have pretty colours