-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #150 from marrink-lab/syntax
Add vim highlighting to the repo
- Loading branch information
Showing
2 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
VIM syntax highlighting for vermouth file formats | ||
================================================= | ||
|
||
This directory contains syntax highlighting rules for VIM to handle vermouth | ||
files. Install them by copying the content of this directory in | ||
`~/.vim/syntax/`. To activate the highlighting, you should copy the following | ||
lines in `~/.vimrc`: | ||
|
||
``` | ||
" Highlighting for vermouth force field files | ||
au BufNewFile,BufRead *.ff set syntax=ff | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
if exists("b:current_syntax") | ||
finish | ||
endif | ||
|
||
syn match ffComment ";.*$" | ||
syn match ffSuperComment ";;.*$" | ||
syn match ffMeta "^#\w\+" | ||
syn match ffMacro "\$\w\+" | ||
|
||
syn match ffMetaError "^#meta\s\+\([^{]\+\)$" | ||
|
||
"syn region ffSection start='\[' end='\]' contains=ffSectionName,ffSectionSpecial | ||
syn match ffSectionName "\[\s*\([A-Za-z0-9_-]\|\s\|\.\)\+\s*\]" | ||
syn match ffSectionRemove "\[\s*\(![A-Za-z0-9_-]\+\)\+\s*\]" | ||
syn match ffSectionSpecial "\[\s*\(edges\|non-edges\|patterns\|molmeta\|features\)\s*\]" | ||
|
||
syn match ffMolType "^\s*\[\s*\(moleculetype\)\s*\]" | ||
syn match ffLink "^\s*\[\s*\(link\)\s*\]" | ||
syn match ffVariables "^\s*\[\s*\(variables\)\s*\]" | ||
syn match ffMacroSectionName "^\s*\[\s*\(macros\)\s*\]" | ||
|
||
syn region ffMacroSection start='^\s*\[\s*macros\s*\]' end='^\s*\['me=e-1 transparent contains=ALL keepend | ||
syn match ffMacroDef "^\(\w\+\)" contained containedin=ffMacroSection | ||
|
||
syn region ffMolecules start='^\s*\[\s*moleculetype\s*\]' end='^\s*\['me=e-1 transparent contains=ALL keepend | ||
syn match ffBlockNameError "^\([A-Za-z0-9_-]\|+\)\+" contained containedin=ffMolecules | ||
syn match ffBlockName "^\([A-Za-z0-9_-]\|+\)\+" contained containedin=ffMolecules nextgroup=ffMolNumber skipwhite | ||
syn match ffMolNumber "\d\+\s*$" contained containedin=ffMolecules | ||
|
||
|
||
hi def link ffComment Comment | ||
hi def link ffSuperComment VimCommentTitle | ||
hi def link ffMeta PreProc | ||
hi def link ffMacro Constant | ||
hi def link ffSectionName Identifier | ||
hi def link ffSectionRemove Structure | ||
hi def link ffSectionSpecial Type | ||
hi def link ffMolNumber level14c | ||
hi def link ffMolType Exception | ||
hi def link ffLink Exception | ||
hi def link ffVariables Exception | ||
hi def link ffMacroSectionName Exception | ||
hi def link ffMacroDef Constant | ||
hi def link ffBlockName String | ||
hi def link ffMetaError Error | ||
|
||
|
||
let b:current_syntax = "ff" |