Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
plumed2-fann
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Kurečka
plumed2-fann
Commits
a2384367
There was an error fetching the commit references. Please try again later.
Commit
a2384367
authored
6 years ago
by
Giovanni Bussi
Browse files
Options
Downloads
Patches
Plain Diff
vim syntax for __FILL__
Useful when working with tutorials
parent
2589bf83
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
user-doc/Miscelaneous.md
+1
-0
1 addition, 0 deletions
user-doc/Miscelaneous.md
vim/vimsyntax.sh
+13
-7
13 additions, 7 deletions
vim/vimsyntax.sh
with
14 additions
and
7 deletions
user-doc/Miscelaneous.md
+
1
−
0
View file @
a2384367
...
...
@@ -190,6 +190,7 @@ As such, all the meaningful words in the input should be highlighted:
-
Values provided by users (such as the number of the atoms following
`ATOMS=`
) will be highlighted with a different color
(
`String`
in VIM).
-
Comments (see
\r
ef comments) will be highlighted as comments (
`Comment`
in VIM).
-
String
`__FILL__`
(extensively used in tutorials to indicate parts to be completed) is highlighted (
`Todo`
in VIM).
If you see something that is not highlighted and appears in black, this is likely going to result in an error at runtime.
Think of this as a sort of preliminary spell-check.
...
...
This diff is collapsed.
Click to expand it.
vim/vimsyntax.sh
+
13
−
7
View file @
a2384367
...
...
@@ -216,13 +216,13 @@ for a in b:plumedActions
elseif(b["menu"]=="(flag)")
let string='"
\v
<' . b["word"] . '>"'
endif
execute 'syntax match plumedKeywords' . action_ . ' ' . string . ' contained contains=plumedStringInKeyword'
execute 'syntax match plumedKeywords' . action_ . ' ' . string . ' contained contains=plumedStringInKeyword
,plumedFillTodo
'
endfor
" single line, with explicit LABEL
" matching action at beginning of line, till the end of the line
" can contain all the keywords associated with this action, plus strings, label, and comments
execute 'syntax region plumedLine' . action_ . ' matchgroup=plumedAction' . action_ . ' start=/
\v
^
\s
*' . action . '>/ excludenl end=/
$/
contains=plumedComment,plumedKeywords' . action_ . ',plumedLabel,plumedStringOneline fold'
execute 'syntax region plumedLine' . action_ . ' matchgroup=plumedAction' . action_ . ' start=/
\v
^
\s
*' . action . '>/ excludenl end=/
$/
contains=plumedComment,plumedKeywords' . action_ . ',plumedLabel,plumedStringOneline
,plumedFillTodo
fold'
" multiple line, with explicit LABEL
" first row might contain extra words before arriving at the dots
" thus continuation dots are matched by plumedDots
...
...
@@ -230,12 +230,12 @@ execute 'syntax region plumedLine' . action_ . ' matchgroup=plumedAction' . acti
" ends on dots, possibly followed by the same action name and possibly a comment
" comments and initial dots are not part of the match
" can contain all the keywords associated with this action, plus strings, label, and comments
execute 'syntax region plumedCLine' . action_ . ' matchgroup=plumedAction' . action_ . ' start=/
\v
^
\s
*' . action . '>(.+
\.\.\.\s
*(#.*)*
$)
@=/ end=/
\v
^
\s
*
\.\.\.
(
\s
+' . action . ')?
\s
*((#.*)*
$)
@=/ contains=plumedComment,plumedKeywords' . action_ . ',plumedLabel,plumedString,plumedDots fold'
execute 'syntax region plumedCLine' . action_ . ' matchgroup=plumedAction' . action_ . ' start=/
\v
^
\s
*' . action . '>(.+
\.\.\.\s
*(#.*)*
$)
@=/ end=/
\v
^
\s
*
\.\.\.
(
\s
+' . action . ')?
\s
*((#.*)*
$)
@=/ contains=plumedComment,plumedKeywords' . action_ . ',plumedLabel,plumedString,plumedDots
,plumedFillTodo
fold'
" single line, with label: syntax
" matching label followed by action
" can contain all the keywords associated with this action, plus strings and comments
" labels are not allwed
execute 'syntax region plumedLLine' . action_ . ' matchgroup=plumedAction' . action_ . ' start=/
\v
^
\s
*[^ #@][^ #]*:
\s
+' . action . '/ excludenl end=/
$/
contains=plumedComment,plumedKeywords' . action_ . ',plumedStringOneline fold'
execute 'syntax region plumedLLine' . action_ . ' matchgroup=plumedAction' . action_ . ' start=/
\v
^
\s
*[^ #@][^ #]*:
\s
+' . action . '/ excludenl end=/
$/
contains=plumedComment,plumedKeywords' . action_ . ',plumedStringOneline
,plumedFillTodo
fold'
" multiple line, with label: syntax
" first row might contain extra words before arriving at the dots
" thus continuation dots are matched by plumedDots
...
...
@@ -243,7 +243,7 @@ execute 'syntax region plumedLLine' . action_ . ' matchgroup=plumedAction' . act
" comments and dots are not part of the match
" ends on dots, possibly followed by the same label and possibly a comment
" comments and initial dots are not part of the match
execute 'syntax region plumedLCLine' . action_ . ' matchgroup=plumedAction' . action_ . ' start=/
\v
^
\s
*
\z
([^ #@][^ #]*
\:
)
\s
+' . action . '>(.+
\.\.\.\s
*(#.*)*
$)
@=/ end=/
\v
^
\s
*
\.\.\.
(
\s
+
\z
1)?
\s
*((#.*)*
$)
@=/ contains=plumedComment,plumedKeywords' . action_ . ',plumedString,plumedDots fold'
execute 'syntax region plumedLCLine' . action_ . ' matchgroup=plumedAction' . action_ . ' start=/
\v
^
\s
*
\z
([^ #@][^ #]*
\:
)
\s
+' . action . '>(.+
\.\.\.\s
*(#.*)*
$)
@=/ end=/
\v
^
\s
*
\.\.\.
(
\s
+
\z
1)?
\s
*((#.*)*
$)
@=/ contains=plumedComment,plumedKeywords' . action_ . ',plumedString,plumedDots
,plumedFillTodo
fold'
" this is a hack required to match the ACTION when it is in the second line
execute 'syntax match plumedSpecial' . action_ . ' /
\v
(
\.\.\.\s
*(#.*)*
\_
s*)@<=' . action . '>/ contained'
execute 'highlight link plumedSpecial' . action_ . ' Type'
...
...
@@ -252,7 +252,7 @@ execute 'highlight link plumedSpecial' . action_ . ' Type'
" matching label, dots, possibly comments, newline, then action name
" comments, dots, and action are not part of the match
" ends on dots possibly followed by the same label and possibly a comment
execute 'syntax region plumedLCLine' . action_ . ' matchgroup=plumedAction' . action_ . ' start=/
\v
^
\s
*
\z
([^ #@][^ #]*
\:
)
\s
+(
\.\.\.\s
*(#.*)*
\_
s*' . action . ')@=/ end=/
\v
^
\s
*
\.\.\.
(
\s
+
\z
1)?
\s
*((#.*)*
$)
@=/ contains=plumedComment,plumedKeywords' . action_ . ',plumedString,plumedSpecial' . action_ . ',plumedDots fold'
execute 'syntax region plumedLCLine' . action_ . ' matchgroup=plumedAction' . action_ . ' start=/
\v
^
\s
*
\z
([^ #@][^ #]*
\:
)
\s
+(
\.\.\.\s
*(#.*)*
\_
s*' . action . ')@=/ end=/
\v
^
\s
*
\.\.\.
(
\s
+
\z
1)?
\s
*((#.*)*
$)
@=/ contains=plumedComment,plumedKeywords' . action_ . ',plumedString,plumedSpecial' . action_ . ',plumedDots
,plumedFillTodo
fold'
execute 'highlight link plumedAction' . action_ . ' Type'
execute 'highlight link plumedKeywords' . action_ . ' Statement'
endfor
...
...
@@ -266,13 +266,19 @@ syntax match plumedStringInKeyword /\v(<[^ #]+\=)@<=[^ #]+/ contained
highlight link plumedStringInKeyword String
" Matching label
syntax match plumedLabel "
\v
<LABEL
\=
[^ #]*" contained contains=plumedLabelWrong
syntax match plumedLabel "
\v
<LABEL
\=
[^ #]*" contained contains=plumedLabelWrong
,plumedFillTodo
highlight link plumedLabel Type
" Errors
syntax match plumedLabelWrong "
\v
<LABEL
\=\@
[^ #]*" contained
highlight link plumedLabelWrong Error
" Todo
" This is used since the Trieste tutorials to indicate
" parts that should be filled by the user
syntax match plumedFillTodo "__FILL__"
highlight link plumedFillTodo Todo
syntax region plumedComment start="
\v
^
\s
*ENDPLUMED>" end="
\%
$"
fold
syntax match plumedComment excludenl "
\v
#.*
$"
highlight link plumedComment Comment
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment