Warning: Undefined array key 1 in /home/np29546/public_html/elmerice/wiki/inc/auth.php on line 78

Warning: Cannot modify header information - headers already sent by (output started at /home/np29546/public_html/elmerice/wiki/inc/auth.php:78) in /home/np29546/public_html/elmerice/wiki/inc/auth.php on line 431

Warning: Undefined array key "DOKU_PREFS" in /home/np29546/public_html/elmerice/wiki/inc/common.php on line 2082

Warning: Cannot modify header information - headers already sent by (output started at /home/np29546/public_html/elmerice/wiki/inc/auth.php:78) in /home/np29546/public_html/elmerice/wiki/inc/common.php on line 2090

Warning: Cannot modify header information - headers already sent by (output started at /home/np29546/public_html/elmerice/wiki/inc/auth.php:78) in /home/np29546/public_html/elmerice/wiki/inc/actions.php on line 38
tips:editors [Elmer/Ice Wiki]

Warning: Undefined array key -1 in /home/np29546/public_html/elmerice/wiki/inc/html.php on line 1458

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
tips:editors [2015/10/23 11:46]
gag
tips:editors [2018/05/16 07:02]
fgillet [Highlighting for Vim]
Line 16: Line 16:
   "A mode for sif files"                                                ;; doc string for this mode   "A mode for sif files"                                                ;; doc string for this mode
   )   )
 +</code>
 +
 +==== Highlighting for Vim =====
 +There is several settings for Vim for automatic highlighting of Solver Input File Syntax (SIF). \\
 +
 +  - There is an elmer-vim plugin available here https://github.com/ettaka/vim-elmer
 +  - Alernatively use the following codes developped by F. Gillet-Chaulet:
 +Under .vim/ folder (should reside in your home-directory), just add:
 +  * the following lines to your filetype.vim
 +<code>
 +augroup filetypedetect
 +au BufNewFile,BufRead *.sif setf sif
 +augroup END
 +"
 +</code>
 +  * the file sif.vim under .vim/syntax/
 +<code>
 +if version < 600
 + syn clear
 +elseif exists("b:current_syntax")
 + finish
 +endif
 +
 +syn case    ignore
 +
 +
 +syn keyword SifType Real Integer Logical String File Procedure MATC
 +
 +syn match  SifNumber            display "[+-]\=\<\d\+\>"
 +syn match  SifFloat           "\<\d\+\(\.\d*\)\=\([edED][-+]\=\d\+\)\=[ij]\=\>"
 +syn match  SifFloat           "\.\d\+\([edED][-+]\=\d\+\)\=[ij]\=\>"
 +syn region  SifString         start=+"+ end=+"+ oneline
 +
 +
 +syn match SifComment "!.*"
 +
 +syn region SifSolvers start="Linear" end="="
 +syn region SifSolvers start="nonlinear" end="="
 +
 +syn match SifSolverHeader "Exec\s*Solver\s*="
 +syn match SifSolverHeader "Variable\s*="
 +syn match SifSolverHeader "Variable\s*Dofs\s*="
 +syn match SifSolverHeader "Equation\s*="
 +syn match SifSolverHeader "procedure\s*="
 +
 +syn match SiftargetBC "Target\s*Boundaries\s*="
 +
 +syntax match MatcFunction "\$\sfunction"  
 +
 +syn keyword SifUnit Simulation Header End
 +syn match  SifUnit "Body\s*\d\+"
 +syn match  SifUnit "Material\s*\d\+"
 +syn match  SifUnit "Solver\s*\d\+"
 +syn match  SifUnit "Equation\s*\d\+"
 +syn match  SifUnit "Initial\s*Condition\s*\d\+"
 +syn match  SifUnit "Body\s*Force\s*\d\+"
 +syn match  SifUnit "Boundary\s*Condition\s*\d\+"
 +
 +
 +hi def SifBold cterm=bold
 +
 +if version >= 508 || !exists("did_sif_syntax_inits")
 + if version < 508
 + let did_sif_syntax_inits = 1
 + command -nargs=+ HiLink hi link <args>
 + else
 + command -nargs=+ HiLink hi def link <args>
 + endif
 +
 +   HiLink SifNumber          Number
 +   HiLink SifFloat           Float
 +   HiLink SifString          String
 +   HiLink SifComment         Comment
 +   HiLink SifUnit            Special
 +   HiLink SifSolvers         Keyword
 +   HiLink SifSolverHeader    SifBold
 +   HiLink MatcFunction       SifBold 
 +   HiLink SiftargetBC        SifBold
 +   HiLink SifType            Type
 +   
 +   delcommand HiLink
 +endif
 +
 +let b:current_syntax = "sif"
 +
 </code> </code>
tips/editors.txt ยท Last modified: 2018/05/16 07:02 by fgillet
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0