Syntax highliting and check is kind of implemented in RouterOS already.
You just need to call the “edit” command on a script to open it in the whole terminal window, where you have that. The syntax check stops at the first syntax error though, but still.
Hi, I not understand this post… is possible open the script and edit directly from winbox with external editor as notepad++ or any other and check the sintax or always is needed download the file first and after upload again with each modification? I tried with ip smb but only see pub folder and the / folder but I not see the scripts, I see all files that I can see like in Winbox in menu files.
When I said “open it in the whole terminal window” I meant it. You can’t open the script in an external program, and have syntax highlighting there… Well, not natively at least. There are 3rd party add-ons for various editors in this topic, though they are - by virtue of not being in sync with an actual router - error prone (e.g. newer commands/arguments may not be recognized as valid OR there won’t be any sort of validation check at all, which in turn limits the usefulness of the highlighting).
If you open up Winbox, click the “New Terminal” button, and from there, type “/system script edit scriptName source” (replacing “scriptName” with the actual name of the script), the terminal windows turns into an editor with syntax highlighting… A very inconvenient to use editor, but an editor still.
Ok, edit option is better that the option in the script window, I think the winbox tool is very good and powerful so I do not think that will prove very complex and it would be much better if implemented to open the default editor windows or associate the user as do the ftp programs or other would be great.
Another option would be that there were scripts like other normal files, so be resolved by SMB like any file.
I was reading the link you say, is like I was doint with notepadd++ and the addon for router os code, so I understand the 3rd party add-ons you say is for copy the code in thats applications, edit and paste in the script windows, it is so or is possible install any addon in winbox to do it?
Any suggestions how to syntax-highlight RouterOS scripts/configs in LibreOffice or MS Office documents ?
Maybe someone have made a plugin for that? ..
Meanwhile, I’m using THIS post to syntax-highlight some RouterOS config, an then copy-paste it as “Formated text” into LibreOffice document
# There was some code to highlight, but, turns out, it doesn't work that way..
# How in the hell it worked yesterday?? I really saw colored code in my LibreOffice, when I pasted it.. Hmm..
I upgraded the old (2012) notepad++ highlitghter with a lot of new keyword (about tool, email, logging, package, ups, radius, capsman, etc, etc, etc,).
I attach it (zipped).
Unzip the xml file in your desktop and then in Notepad++ go to: Language->User Defined Language->Import
Close and reopen Notepad++
My editor of choice is vis - a modern, legacy free, simple yet efficient vim-like editor.
I added a RouterOS script lexer, that is now available in git master.