From 2cab8a49e64b725dbbf048549e7e9a9a4fdc0a3b Mon Sep 17 00:00:00 2001 From: sjplimp Date: Fri, 4 Jan 2008 15:22:54 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@1302 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- tools/README | 1 + tools/vim/README.txt | 20 +++++++++++++++ tools/vim/lammps.vim | 57 ++++++++++++++++++++++++++++++++++++++++++ tools/vim/mysyntax.vim | 3 +++ tools/vim/vimrc | 2 ++ 5 files changed, 83 insertions(+) create mode 100644 tools/vim/README.txt create mode 100644 tools/vim/lammps.vim create mode 100644 tools/vim/mysyntax.vim create mode 100644 tools/vim/vimrc diff --git a/tools/README b/tools/README index 4f22ed919b..dad2a39c10 100644 --- a/tools/README +++ b/tools/README @@ -24,6 +24,7 @@ micelle2d create a data file of small lipid chains in solvent msi2lmp use Accelrys Insight code to setup LAMMPS input pymol_asphere convert LAMMPS output of ellipsoids to PyMol format restart2data convert a binary restart file to an input data file +vim add-ons to VIM editor for editing LAMMPS input scripts xmovie a quick/simple viz package (2d projections of 3d) For tools that are single C, C++, or Fortran files, a Makefile for diff --git a/tools/vim/README.txt b/tools/vim/README.txt new file mode 100644 index 0000000000..9b1ec33cd4 --- /dev/null +++ b/tools/vim/README.txt @@ -0,0 +1,20 @@ +=== Vim Syntax Highlighting === +=============================== + +The files provided in this directory will enable syntax highlighting +for the lammps script syntax in vim. The simulation scripts have to +end on .lmp (see mysyntax.vim). By far not all commands are included +in the syntax file (lammps.vim). You can easily add new ones. + +=To enable the highlighting: +============================ +(0) Create a ~/.vimrc + You can have a look in /usr/local/share/vim/current/vimrc.example +(1) Insert in ~/.vimrc + let mysyntaxfile = "~/.vim/mysyntax.vim" + just before + syntax on +(2) Create directory ~/.vim and place mysyntax.vim and lammps.vim there + +Gerolf Ziegenhain 2007 + diff --git a/tools/vim/lammps.vim b/tools/vim/lammps.vim new file mode 100644 index 0000000000..b1bcd820d4 --- /dev/null +++ b/tools/vim/lammps.vim @@ -0,0 +1,57 @@ +" Vim syntax file +" Language: Lammps Simulation Script File +" Maintainer: Gerolf Ziegenhain +" Latest Revision: 2007-11-19 + +syn clear + +syn keyword lammpsOutput log write_restart dump undump thermo thermo_modify thermo_style print +syn keyword lammpsRead include read read_restart read_data +syn keyword lammpsLattice boundary units atom_style lattice region create_box create_atoms +syn keyword lammpsLattice delete_atoms change_box dimension +syn keyword lammpsParticle pair_coeff pair_style mass angle_coeff angle_style atom_modify +syn keyword lammpsParticle atom_style bond_coeff bond_style delete_bonds +syn keyword lammpsSetup min_style fix_modify run_style timestep neighbor fix unfix +syn keyword lammpsRun minimize run +syn keyword lammpsDefine variable + +syn keyword lammpsRepeat jump next loop + +syn keyword lammpsOperator equal add sub mult div + +syn keyword lammpsConditional if then else + +syn region lammpsString start=+'+ end=+'+ oneline +syn region lammpsString start=+"+ end=+"+ oneline + +syn match lammpsNumber "\<[0-9]\+[ij]\=\>" +syn match lammpsFloat "\<[0-9]\+\.[0-9]*\([edED][-+]\=[0-9]\+\)\=[ij]\=\>" +syn match lammpsFloat "\.[0-9]\+\([edED][-+]\=[0-9]\+\)\=[ij]\=\>" +syn match lammpsFloat "\<[0-9]\+[edED][-+]\=[0-9]\+[ij]\=\>" + +syn match lammpsComment "#.*$" + +syn match lammpsVariable "\$\({[a-zA-Z0-9]\+}\)" +syn match lammpsVariable "\$[A-Za-z]" + +if !exists("did_lammps_syntax_inits") + let did_lammps_syntax_inits = 1 + hi link lammpsOutput Function + hi link lammpsRepeat Repeat + hi link lammpsRead Include + hi link lammpsLattice Typedef + hi link lammpsParticle Typedef + hi link lammpsSetup Typedef + hi link lammpsDefine Define + hi link lammpsRun Statement + hi link lammpsNumber Number + hi link lammpsFloat Float + hi link lammpsString String + hi link lammpsComment Comment + hi link lammpsLoop Repeat + hi link lammpsVariable Identifier + hi link lammpsConditional Conditional + hi link lammpsOperator Operator +endif + +let b:current_syntax = "lammps" diff --git a/tools/vim/mysyntax.vim b/tools/vim/mysyntax.vim new file mode 100644 index 0000000000..7c2d46ef52 --- /dev/null +++ b/tools/vim/mysyntax.vim @@ -0,0 +1,3 @@ +augroup syntax +au BufNewFile,BufReadPost *.lmp so ~/.vim/lammps.vim +augroup END diff --git a/tools/vim/vimrc b/tools/vim/vimrc new file mode 100644 index 0000000000..724e077eac --- /dev/null +++ b/tools/vim/vimrc @@ -0,0 +1,2 @@ +let mysyntaxfile = "~/.vim/mysyntax.vim" +syntax on