From aed8ce9da277f5ecffe968b324f242c41c3b752a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 10:50:31 +0200 Subject: Adding upstream version 2:9.0.1378. Signed-off-by: Daniel Baumann --- runtime/syntax/routeros.vim | 91 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 runtime/syntax/routeros.vim (limited to 'runtime/syntax/routeros.vim') diff --git a/runtime/syntax/routeros.vim b/runtime/syntax/routeros.vim new file mode 100644 index 0000000..b6effc9 --- /dev/null +++ b/runtime/syntax/routeros.vim @@ -0,0 +1,91 @@ +" Vim syntax file +" Language: MikroTik RouterOS Script +" Maintainer: zainin +" Original Author: ndbjorne @ MikroTik forums +" Last Change: 2021 Nov 14 + +" quit when a syntax file was already loaded +if exists("b:current_syntax") + finish +endif + +syn case ignore + +syn iskeyword @,48-57,- + +" comments +syn match routerosComment /^\s*\zs#.*/ + +" options submenus: /interface ether1 etc +syn match routerosSubMenu "\([a-z]\)\@=!~^&.,]\ze " +syn match routerosOperator "[<>!]=" +syn match routerosOperator "<<\|>>" +syn match routerosOperator "[+-]\d\@=" + +syn keyword routerosOperator and or in + +" commands +syn keyword routerosCommands beep delay put len typeof pick log time set find environment +syn keyword routerosCommands terminal error parse resolve toarray tobool toid toip toip6 +syn keyword routerosCommands tonum tostr totime add remove enable disable where get print +syn keyword routerosCommands export edit find append as-value brief detail count-only file +syn keyword routerosCommands follow follow-only from interval terse value-list without-paging +syn keyword routerosCommands return + +" variable types +syn keyword routerosType global local + +" loop keywords +syn keyword routerosRepeat do while for foreach + +syn match routerosSpecial "[():[\]{|}]" + +syn match routerosLineContinuation "\\$" + +syn match routerosEscape "\\["\\nrt$?_abfv]" contained display +syn match routerosEscape "\\\x\x" contained display + +syn region routerosString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=routerosEscape,routerosLineContinuation + +hi link routerosComment Comment +hi link routerosSubMenu Function +hi link routerosVariable Identifier +hi link routerosDelimiter Operator +hi link routerosEscape Special +hi link routerosService Type +hi link routerosInterface Type +hi link routerosBoolean Boolean +hi link routerosConditional Conditional +hi link routerosOperator Operator +hi link routerosCommands Operator +hi link routerosType Type +hi link routerosRepeat Repeat +hi link routerosSpecial Delimiter +hi link routerosString String +hi link routerosLineContinuation Special + +let b:current_syntax = "routeros" -- cgit v1.2.3