Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018 uporersith
Copyright (c) 2023 uporersith

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
28 changes: 20 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ Syntax file for the VIM text Editor for Fire Dynamics Simulator Input files.

Script requires grep to be installed.

usage:
## Usage
1) clone a copy of the Git Repository:
$git clone https://github.com/firemodels/fds.git
```sh
$git clone https://github.com/firemodels/fds.git
```
2) show the list of tags to get the latest stable release:
$cd fds
$git tag
Expand All @@ -17,12 +19,22 @@ $git clone https://github.com/firemodels/fds.git
3) checkout the latest stable release
$git checkout 'FDS6.7.0'
4) switch to the Source dir, then run the script:
fds_make_syn.pl
```sh
fds_make_syn.pl
```
The script will find all files with the NAMELIST keyword and and parses all the lines: NAMELIST ....
to get all the syntax keywords

outputs fds.vim
Place the fds.vim file in the $HOME/vimfiles/syntax folder
add the line:
au BufNewFile,BufRead *.fds setf fds
To the filetype.vim file
outputs **fds.vim**

---

Place the generated **fds.vim** file in the vim syntax folder[^1] and add the line:
```sh
au BufNewFile,BufRead *.fds setf fds
```
To the filetype.vim file[^2]

[^1]: Common install locations $HOME/.vim/syntax (unix-based), $/HOME/vimfiles/syntax (unix-based) and \<Program files\>\Vim\vim\<version\>\syntax (windows)
[^2]: Typically located in /usr/share/vim/vim\<version\>/filetype.vim (unix-based) and \<Program Files\>\Vim\vim\<version\>\filetype.vim (windows)

6 changes: 3 additions & 3 deletions fds.vim
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ syn match hBool /\(\.TRUE\.\)\|\(\.FALSE\.\)/ contained
"Numbers of various sorts, Copied the Fortran syntax file

" Integers
syn match FDSInterger display "\<\d\+\(_\a\w*\)\=\>"
syn match FDSInteger display "\<\d\+\(_\a\w*\)\=\>"
" floating point number, without a decimal point
syn match FDSFloat display "\<\d\+[deEq][-+]\=\d\+\(_\a\w*\)\=\>"
" floating point number, starting with a decimal point
Expand All @@ -321,7 +321,7 @@ syn match FDSOperator "\(\(>\|<\)=\=\|==\|/=\|=\)"
syntax region hString start=/"\|'/ end=/"\|'/ contained

" instructions - Anything that begins with & and end with /
syn region instructions start=/^\s*&/ end=/[/]/ contains=FDS4OBS,hstring,FDS5PA,NAMELIST,FDSNumber,FDSFloat,FDSInterger,FDSOperator,hBool contained
syn region instructions start=/^\s*&/ end=/[/]/ contains=FDS4OBS,hstring,FDS5PA,NAMELIST,FDSNumber,FDSFloat,FDSInteger,FDSOperator,hBool contained

" comments: everything is a comment, unless it is an instruction, see above
syn match comment /.*/ contains=instructions
Expand All @@ -344,7 +344,7 @@ if version >= 508 || !exists("did_blank_syntax_inits")
HiLink FDS4OBS Error
HiLink instructions Statement
HiLink FDSNumber Number
HiLink FDSInterger Number
HiLink FDSInteger Number
HiLink FDSFloat Number
HiLink hBool Boolean
HiLink comment Comment
Expand Down
6 changes: 3 additions & 3 deletions fds_make_syn.pl
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ sub print_footer{
print SYNOUT "\"Numbers of various sorts, Copied the Fortran syntax file\n";
print SYNOUT "\n";
print SYNOUT "\" Integers\n";
print SYNOUT "syn match FDSInterger display \"\\<\\d\\+\\(_\\a\\w*\\)\\=\\>\"\n";
print SYNOUT "syn match FDSInteger display \"\\<\\d\\+\\(_\\a\\w*\\)\\=\\>\"\n";
print SYNOUT "\" floating point number, without a decimal point\n";
print SYNOUT "syn match FDSFloat display \"\\<\\d\\+[deq][-+]\\=\\d\\+\\(_\\a\\w*\\)\\=\\>\"\n";
print SYNOUT "\" floating point number, starting with a decimal point\n";
Expand All @@ -215,7 +215,7 @@ sub print_footer{
print SYNOUT "syntax region hString start=/\"\\|\'/ end=/\"\\|\'/ contained\n";
print SYNOUT "\n";
print SYNOUT "\" instructions - Anything that begins with & and end with /\n";
print SYNOUT "syn region instructions start=/^\\s*&/ end=/[/]/ contains=FDS4OBS,hstring,FDS5PA,NAMELIST,FDSNumber,FDSFloat,FDSInterger,FDSOperator,hBool contained\n";
print SYNOUT "syn region instructions start=/^\\s*&/ end=/[/]/ contains=FDS4OBS,hstring,FDS5PA,NAMELIST,FDSNumber,FDSFloat,FDSInteger,FDSOperator,hBool contained\n";
print SYNOUT "\n";
print SYNOUT "\" comments: everything is a comment, unless it is an instruction, see above\n";
print SYNOUT "syn match comment /.*/ contains=instructions\n";
Expand All @@ -238,7 +238,7 @@ sub print_footer{
print SYNOUT " HiLink FDS4OBS Error\n";
print SYNOUT " HiLink instructions Statement\n";
print SYNOUT " HiLink FDSNumber Number\n";
print SYNOUT " HiLink FDSInterger Number\n";
print SYNOUT " HiLink FDSInteger Number\n";
print SYNOUT " HiLink FDSFloat Number\n";
print SYNOUT " HiLink hBool Boolean\n";
print SYNOUT " HiLink comment Comment\n";
Expand Down