📄 spup.vim
字号:
" Vim syntax file" Language: Speedup, plant simulator from AspenTech" Maintainer: Stefan.Schwarzer <s.schwarzer@ndh.net>" URL: http://www.ndh.net/home/sschwarzer/download/spup.vim" Last Change: 2001 Apr 29" Filename: spup.vim" Bugs" - in the appropriate sections keywords are always highlighted" even if they are not used with the appropriate meaning;" example: in" MODEL demonstration" TYPE" *area AS area" both "area" are highlighted as spupType."" If you encounter problems or have questions or suggestions, mail me" Remove old syntax stuff" For version 5.x: Clear all syntax items" For version 6.x: Quit when a syntax file was already loadedif version < 600 syntax clearelseif exists("b:current_syntax") finishendif" don't hightlight several keywords like subsections"let strict_subsections = 1" highlight types usually found in DECLARE sectionif !exists("hightlight_types") let highlight_types = 1endif" one line comment syntax (# comments)" 1. allow appended code after comment, do not complain" 2. show code beginnig with the second # as an error" 3. show whole lines with more than one # as an errorif !exists("oneline_comments") let oneline_comments = 2endif" Speedup SECTION regionssyn case ignoresyn region spupCdi matchgroup=spupSection start="^CDI" end="^\*\*\*\*" contains=spupCdiSubs,@spupOrdinarysyn region spupConditions matchgroup=spupSection start="^CONDITIONS" end="^\*\*\*\*" contains=spupConditionsSubs,@spupOrdinary,spupConditional,spupOperator,spupCodesyn region spupDeclare matchgroup=spupSection start="^DECLARE" end="^\*\*\*\*" contains=spupDeclareSubs,@spupOrdinary,spupTypes,spupCodesyn region spupEstimation matchgroup=spupSection start="^ESTIMATION" end="^\*\*\*\*" contains=spupEstimationSubs,@spupOrdinarysyn region spupExternal matchgroup=spupSection start="^EXTERNAL" end="^\*\*\*\*" contains=spupExternalSubs,@spupOrdinarysyn region spupFlowsheet matchgroup=spupSection start="^FLOWSHEET" end="^\*\*\*\*" contains=spupFlowsheetSubs,@spupOrdinary,spupStreams,@spupTextprocsyn region spupFunction matchgroup=spupSection start="^FUNCTION" end="^\*\*\*\*" contains=spupFunctionSubs,@spupOrdinary,spupHelp,spupCode,spupTypessyn region spupGlobal matchgroup=spupSection start="^GLOBAL" end="^\*\*\*\*" contains=spupGlobalSubs,@spupOrdinarysyn region spupHomotopy matchgroup=spupSection start="^HOMOTOPY" end="^\*\*\*\*" contains=spupHomotopySubs,@spupOrdinarysyn region spupMacro matchgroup=spupSection start="^MACRO" end="^\*\*\*\*" contains=spupMacroSubs,@spupOrdinary,@spupTextproc,spupTypes,spupStreams,spupOperatorsyn region spupModel matchgroup=spupSection start="^MODEL" end="^\*\*\*\*" contains=spupModelSubs,@spupOrdinary,spupConditional,spupOperator,spupTypes,spupStreams,@spupTextproc,spupHelpsyn region spupOperation matchgroup=spupSection start="^OPERATION" end="^\*\*\*\*" contains=spupOperationSubs,@spupOrdinary,@spupTextprocsyn region spupOptions matchgroup=spupSection start="^OPTIONS" end="^\*\*\*\*" contains=spupOptionsSubs,@spupOrdinarysyn region spupProcedure matchgroup=spupSection start="^PROCEDURE" end="^\*\*\*\*" contains=spupProcedureSubs,@spupOrdinary,spupHelp,spupCode,spupTypessyn region spupProfiles matchgroup=spupSection start="^PROFILES" end="^\*\*\*\*" contains=@spupOrdinary,@spupTextprocsyn region spupReport matchgroup=spupSection start="^REPORT" end="^\*\*\*\*" contains=spupReportSubs,@spupOrdinary,spupHelp,@spupTextprocsyn region spupTitle matchgroup=spupSection start="^TITLE" end="^\*\*\*\*" contains=spupTitleSubs,spupComment,spupConstant,spupErrorsyn region spupUnit matchgroup=spupSection start="^UNIT" end="^\*\*\*\*" contains=spupUnitSubs,@spupOrdinary" Subsectionssyn keyword spupCdiSubs INPUT FREE OUTPUT LINEARTIME MINNONZERO CALCULATE FILES SCALING containedsyn keyword spupDeclareSubs TYPE STREAM containedsyn keyword spupEstimationSubs ESTIMATE SSEXP DYNEXP RESULT containedsyn keyword spupExternalSubs TRANSMIT RECEIVE containedsyn keyword spupFlowsheetSubs STREAM containedsyn keyword spupFunctionSubs INPUT OUTPUT containedsyn keyword spupGlobalSubs VARIABLES MAXIMIZE MINIMIZE CONSTRAINT containedsyn keyword spupHomotopySubs VARY OPTIONS containedsyn keyword spupMacroSubs MODEL FLOWSHEET containedsyn keyword spupModelSubs CATEGORY SET TYPE STREAM EQUATION PROCEDURE containedsyn keyword spupOperationSubs SET PRESET INITIAL SSTATE FREE containedsyn keyword spupOptionsSubs ROUTINES TRANSLATE EXECUTION containedsyn keyword spupProcedureSubs INPUT OUTPUT SPACE PRECALL POSTCALL DERIVATIVE STREAM contained" no subsections for Profilessyn keyword spupReportSubs SET INITIAL FIELDS FIELDMARK DISPLAY WITHIN containedsyn keyword spupUnitSubs ROUTINES SET contained" additional keywords for subsectionsif !exists( "strict_subsections" ) syn keyword spupConditionsSubs STOP PRINT contained syn keyword spupDeclareSubs UNIT SET COMPONENTS THERMO OPTIONS contained syn keyword spupEstimationSubs VARY MEASURE INITIAL contained syn keyword spupFlowsheetSubs TYPE FEED PRODUCT INPUT OUTPUT CONNECTION OF IS contained syn keyword spupMacroSubs CONNECTION STREAM SET INPUT OUTPUT OF IS FEED PRODUCT TYPE contained syn keyword spupModelSubs AS ARRAY OF INPUT OUTPUT CONNECTION contained syn keyword spupOperationSubs WITHIN contained syn keyword spupReportSubs LEFT RIGHT CENTER CENTRE UOM TIME DATE VERSION RELDATE contained syn keyword spupUnitSubs IS A containedendif" Speedup data typesif exists( "highlight_types" ) syn keyword spupTypes act_coeff_liq area coefficient concentration contained syn keyword spupTypes control_signal cond_liq cond_vap cp_mass_liq contained syn keyword spupTypes cp_mol_liq cp_mol_vap cv_mol_liq cv_mol_vap contained syn keyword spupTypes diffus_liq diffus_vap delta_p dens_mass contained syn keyword spupTypes dens_mass_sol dens_mass_liq dens_mass_vap dens_mol contained syn keyword spupTypes dens_mol_sol dens_mol_liq dens_mol_vap enthflow contained syn keyword spupTypes enth_mass enth_mass_liq enth_mass_vap enth_mol contained syn keyword spupTypes enth_mol_sol enth_mol_liq enth_mol_vap entr_mol contained syn keyword spupTypes entr_mol_sol entr_mol_liq entr_mol_vap fraction contained syn keyword spupTypes flow_mass flow_mass_liq flow_mass_vap flow_mol contained syn keyword spupTypes flow_mol_vap flow_mol_liq flow_vol flow_vol_vap contained syn keyword spupTypes flow_vol_liq fuga_vap fuga_liq fuga_sol contained syn keyword spupTypes gibb_mol_sol heat_react heat_trans_coeff contained syn keyword spupTypes holdup_heat holdup_heat_liq holdup_heat_vap contained syn keyword spupTypes holdup_mass holdup_mass_liq holdup_mass_vap contained syn keyword spupTypes holdup_mol holdup_mol_liq holdup_mol_vap k_value contained syn keyword spupTypes length length_delta length_short liqfraction contained syn keyword spupTypes liqmassfraction mass massfraction molefraction contained syn keyword spupTypes molweight moment_inertia negative notype percent contained syn keyword spupTypes positive pressure press_diff press_drop press_rise contained syn keyword spupTypes ratio reaction reaction_mass rotation surf_tens contained syn keyword spupTypes temperature temperature_abs temp_diff temp_drop contained syn keyword spupTypes temp_rise time vapfraction vapmassfraction contained syn keyword spupTypes velocity visc_liq visc_vap volume zmom_rate contained syn keyword spupTypes seg_rate smom_rate tmom_rate zmom_mass seg_mass contained syn keyword spupTypes smom_mass tmom_mass zmom_holdup seg_holdup contained syn keyword spupTypes smom_holdup tmom_holdup containedendif" stream typessyn keyword spupStreams mainstream vapour liquid contained" "conditional" keywordssyn keyword spupConditional IF THEN ELSE ENDIF contained" Operators, symbols etc.syn keyword spupOperator AND OR NOT containedsyn match spupSymbol "[,\-+=:;*/\"<>@%()]" containedsyn match spupSpecial "[&\$?]" contained" Surprisingly, Speedup allows no unary + instead of the -syn match spupError "[(=+\-*/]\s*+\d\+\([ed][+-]\=\d\+\)\=\>"lc=1 containedsyn match spupError "[(=+\-*/]\s*+\d\+\.\([ed][+-]\=\d\+\)\=\>"lc=1 containedsyn match spupError "[(=+\-*/]\s*+\d*\.\d\+\([ed][+-]\=\d\+\)\=\>"lc=1 contained" Stringsyn region spupString start=+"+ end=+"+ oneline containedsyn region spupString start=+'+ end=+'+ oneline contained" Identifiersyn match spupIdentifier "\<[a-z][a-z0-9_]*\>" contained" Textprocessor directivessyn match spupTextprocGeneric "?[a-z][a-z0-9_]*\>" containedsyn region spupTextprocError matchgroup=spupTextprocGeneric start="?ERROR" end="?END"he=s-1 contained" Number, without decimal pointsyn match spupNumber "-\=\d\+\([ed][+-]\=\d\+\)\=" contained" Number, allows 1. before exponentsyn match spupNumber "-\=\d\+\.\([ed][+-]\=\d\+\)\=" contained" Number allows .1 before exponentsyn match spupNumber "-\=\d*\.\d\+\([ed][+-]\=\d\+\)\=" contained" Help subsectionssyn region spupHelp start="^HELP"hs=e+1 end="^\$ENDHELP"he=s-1 contained" Fortran codesyn region spupCode start="^CODE"hs=e+1 end="^\$ENDCODE"he=s-1 contained" oneline commentsif oneline_comments > 3 oneline_comments = 2 " defaultendifif oneline_comments == 1 syn match spupComment "#[^#]*#\="elseif oneline_comments == 2 syn match spupError "#.*$" syn match spupComment "#[^#]*" nextgroup=spupErrorelseif oneline_comments == 3 syn match spupComment "#[^#]*" syn match spupError "#[^#]*#.*"endif" multiline commentssyn match spupOpenBrace "{" containedsyn match spupError "}"syn region spupComment matchgroup=spupComment2 start="{" end="}" keepend contains=spupOpenBracesyn cluster spupOrdinary contains=spupNumber,spupIdentifier,spupSymbolsyn cluster spupOrdinary add=spupError,spupString,spupCommentsyn cluster spupTextproc contains=spupTextprocGeneric,spupTextprocError" define syncronizing; especially OPERATION sections can become very largesyn sync clearsyn sync minlines=100syn sync maxlines=500syn sync match spupSyncOperation grouphere spupOperation "^OPERATION"syn sync match spupSyncCdi grouphere spupCdi "^CDI"syn sync match spupSyncConditions grouphere spupConditions "^CONDITIONS"syn sync match spupSyncDeclare grouphere spupDeclare "^DECLARE"syn sync match spupSyncEstimation grouphere spupEstimation "^ESTIMATION"syn sync match spupSyncExternal grouphere spupExternal "^EXTERNAL"syn sync match spupSyncFlowsheet grouphere spupFlowsheet "^FLOWSHEET"syn sync match spupSyncFunction grouphere spupFunction "^FUNCTION"syn sync match spupSyncGlobal grouphere spupGlobal "^GLOBAL"syn sync match spupSyncHomotopy grouphere spupHomotopy "^HOMOTOPY"syn sync match spupSyncMacro grouphere spupMacro "^MACRO"syn sync match spupSyncModel grouphere spupModel "^MODEL"syn sync match spupSyncOperation grouphere spupOperation "^OPERATION"syn sync match spupSyncOptions grouphere spupOptions "^OPTIONS"syn sync match spupSyncProcedure grouphere spupProcedure "^PROCEDURE"syn sync match spupSyncProfiles grouphere spupProfiles "^PROFILES"syn sync match spupSyncReport grouphere spupReport "^REPORT"syn sync match spupSyncTitle grouphere spupTitle "^TITLE"syn sync match spupSyncUnit grouphere spupUnit "^UNIT"" Define the default highlighting." For version 5.7 and earlier: only when not done already" For version 5.8 and later: only when an item doesn't have highlighting yetif version >= 508 || !exists("did_spup_syn_inits") if version < 508 let did_spup_syn_inits = 1 command -nargs=+ HiLink hi link <args> else command -nargs=+ HiLink hi def link <args> endif HiLink spupCdi spupSection HiLink spupConditions spupSection HiLink spupDeclare spupSection HiLink spupEstimation spupSection HiLink spupExternal spupSection HiLink spupFlowsheet spupSection HiLink spupFunction spupSection HiLink spupGlobal spupSection HiLink spupHomotopy spupSection HiLink spupMacro spupSection HiLink spupModel spupSection HiLink spupOperation spupSection HiLink spupOptions spupSection HiLink spupProcedure spupSection HiLink spupProfiles spupSection HiLink spupReport spupSection HiLink spupTitle spupConstant " this is correct, truly ;) HiLink spupUnit spupSection HiLink spupCdiSubs spupSubs HiLink spupConditionsSubs spupSubs HiLink spupDeclareSubs spupSubs HiLink spupEstimationSubs spupSubs HiLink spupExternalSubs spupSubs HiLink spupFlowsheetSubs spupSubs HiLink spupFunctionSubs spupSubs HiLink spupHomotopySubs spupSubs HiLink spupMacroSubs spupSubs HiLink spupModelSubs spupSubs HiLink spupOperationSubs spupSubs HiLink spupOptionsSubs spupSubs HiLink spupProcedureSubs spupSubs HiLink spupReportSubs spupSubs HiLink spupUnitSubs spupSubs HiLink spupCode Normal HiLink spupComment Comment HiLink spupComment2 spupComment HiLink spupConditional Statement HiLink spupConstant Constant HiLink spupError Error HiLink spupHelp Normal HiLink spupIdentifier Identifier HiLink spupNumber Constant HiLink spupOperator Special HiLink spupOpenBrace spupError HiLink spupSection Statement HiLink spupSpecial spupTextprocGeneric HiLink spupStreams Type HiLink spupString Constant HiLink spupSubs Statement HiLink spupSymbol Special HiLink spupTextprocError Normal HiLink spupTextprocGeneric PreProc HiLink spupTypes Type delcommand HiLinkendiflet b:current_syntax = "spup"" vim:ts=4
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -