This shows you the differences between two versions of the page.
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" | "A mode for sif files" | ||
) | ) | ||
+ | </ | ||
+ | |||
+ | ==== 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:// | ||
+ | - Alernatively use the following codes developped by F. Gillet-Chaulet: | ||
+ | Under .vim/ folder (should reside in your home-directory), | ||
+ | * the following lines to your filetype.vim | ||
+ | < | ||
+ | augroup filetypedetect | ||
+ | au BufNewFile, | ||
+ | augroup END | ||
+ | " | ||
+ | </ | ||
+ | * the file sif.vim under .vim/ | ||
+ | < | ||
+ | if version < 600 | ||
+ | syn clear | ||
+ | elseif exists(" | ||
+ | finish | ||
+ | endif | ||
+ | |||
+ | syn case ignore | ||
+ | |||
+ | |||
+ | syn keyword SifType Real Integer Logical String File Procedure MATC | ||
+ | |||
+ | syn match SifNumber | ||
+ | syn match SifFloat | ||
+ | syn match SifFloat | ||
+ | syn region | ||
+ | |||
+ | |||
+ | syn match SifComment " | ||
+ | |||
+ | syn region SifSolvers start=" | ||
+ | syn region SifSolvers start=" | ||
+ | |||
+ | syn match SifSolverHeader " | ||
+ | syn match SifSolverHeader " | ||
+ | syn match SifSolverHeader " | ||
+ | syn match SifSolverHeader " | ||
+ | syn match SifSolverHeader " | ||
+ | |||
+ | syn match SiftargetBC " | ||
+ | |||
+ | syntax match MatcFunction " | ||
+ | |||
+ | syn keyword SifUnit Simulation Header End | ||
+ | syn match SifUnit " | ||
+ | syn match SifUnit " | ||
+ | syn match SifUnit " | ||
+ | syn match SifUnit " | ||
+ | syn match SifUnit " | ||
+ | syn match SifUnit " | ||
+ | syn match SifUnit " | ||
+ | |||
+ | |||
+ | hi def SifBold cterm=bold | ||
+ | |||
+ | if version >= 508 || !exists(" | ||
+ | if version < 508 | ||
+ | let did_sif_syntax_inits = 1 | ||
+ | command -nargs=+ HiLink hi link < | ||
+ | else | ||
+ | command -nargs=+ HiLink hi def link < | ||
+ | endif | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | | ||
+ | endif | ||
+ | |||
+ | let b: | ||
+ | |||
</ | </ |