I didn't find where to put it... can you tell me where or put it there yourself?thanks ..
why not put your ros.xml on notepad++ wiki
SENZATEMPO
1. Download Notepad++: http://www.notepadplusplus.orgHi all...
may i know how to use this?
thanks.
Hi....1. Download Notepad++: http://www.notepadplusplus.orgHi all...
may i know how to use this?
thanks.
2. Install Notepad++
3. Download file above: http://forum.mikrotik.com/viewtopic.php ... 61#p305377
4. Open Notepad++, and click View > User-Defined Dialogue > click Import button. Import the xml file you just downloaded.
5. Open a .rsc script, and syntax highlighting will be visible.
I've made some improvements to the colour scheme (matching what's in winbox) and added a bunch more keywords; do you mind if I upload a copy of my modified version here and host another one on my website?I edit my configuration offline the routeros, so syntax highlighting would be a good help.
I use notepad++ and this morning made a "user defined lang" highlighting schema for .rsc files. I attach it (zipped).
Sure it's not perfect, but if anyone has better editor with routeros syntax, let me know!
d
I like the improvements! CoolI've made some improvements to the colour scheme (matching what's in winbox) and added a bunch more keywords; do you mind if I upload a copy of my modified version here and host another one on my website?
[b]mkdir -p ~/.vim/syntax[/b]
[b]~/.vim/scripts.vim[/b]
[b]" Vim support file to detect file types in scripts
"
" first line check
let s:first_line = getline(1)
" Mikrotik RouterOS script
if s:first_line =~ "^#.* by RouterOS"
setfiletype rsc
endif
unlet s:first_line[/b]
I'll throw my vote in for TextMate 2 or Sublime Text 2/3 ... If anyone has done them yet.Hi,
my editor of choice is VIM and here's my VIM syntax file based on dtoffo's work.
Linux HowTo:
create your own syntax repository
and copy there "rsc.vim", then editCode: Select all[b]mkdir -p ~/.vim/syntax[/b]
and add lines to let vim recognize them.Code: Select all[b]~/.vim/scripts.vim[/b]
Just in case this is your first custom syntax file here's the content for a minimal scripts.vim file:
Hope you'll like it.Code: Select all[b]" Vim support file to detect file types in scripts " " first line check let s:first_line = getline(1) " Mikrotik RouterOS script if s:first_line =~ "^#.* by RouterOS" setfiletype rsc endif unlet s:first_line[/b]
Syntax highliting and check is kind of implemented in RouterOS already.I wonder why the syntax check (and debugging) is not already implmented in ROS/WinBox...
Hi,
my editor of choice is VIM and here's my VIM syntax file based on dtoffo's work.
Linux HowTo:
create your own syntax repository
and copy there "rsc.vim", then editCode: Select allmkdir -p ~/.vim/syntax
and add lines to let vim recognize them.Code: Select all~/.vim/scripts.vim
Just in case this is your first custom syntax file here's the content for a minimal scripts.vim file:
Hope you'll like it.Code: Select all" Vim support file to detect file types in scripts " " first line check let s:first_line = getline(1) " Mikrotik RouterOS script if s:first_line =~ "^#.* by RouterOS" setfiletype rsc endif unlet s:first_line
mkdir -p ~/.vim/ftdetect
au BufRead,BufNewFile *.rsc set filetype=rsc
See http://forum.mikrotik.com/viewtopic.php?f=9&t=81868.Is there plugin for Sublime Text 2? It's a great editor.
+1 for thisAnyone has it for textWrangler ?
Thx.
ThanksI edit my configuration offline the routeros, so syntax highlighting would be a good help.
I use notepad++ and this morning made a "user defined lang" highlighting schema for .rsc files. I attach it (zipped).
Sure it's not perfect, but if anyone has better editor with routeros syntax, let me know!
d
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.Syntax highliting and check is kind of implemented in RouterOS already.I wonder why the syntax check (and debugging) is not already implmented in ROS/WinBox...
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.
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.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.
# 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..
Don't use Libre or MS Office for codeAny 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
Code: Select all# 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..
This is awesome.I edit my configuration offline the routeros, so syntax highlighting would be a good help.
I use notepad++ and this morning made a "user defined lang" highlighting schema for .rsc files. I attach it (zipped).
Sure it's not perfect, but if anyone has better editor with routeros syntax, let me know!
d
Thank you very much!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).
thanks to dtoffo for his initial work in 2012.
Highlighting for Kate (editor in KDE5)
Create (if not exist) folder ~/.local/share/katepart5/syntax/ and place xml file there RouterOS.xml
Restart Kate, than open Kate settings and in colors settings in style select RouterOS highlighting and import from file RouterOS.katehlcolor from archive RouterOS.katehlcolor.zip (unpack it before!)
You can set you own colors and text style also in this menu
%USERPROFILE%\AppData\Local\org.kde.syntax-highlighting\syntax\
(create org.kde.syntax-highlighting and syntax if they do not already exist.)
Atom with highlighting extension from ofstudioWhich editor(s) do you use?
Highlighting for Kate (editor in KDE5)
Create (if not exist) folder ~/.local/share/katepart5/syntax/ and place xml file there Restart Kate, than open Kate settings and in colors settings in style select RouterOS highlighting and import from file RouterOS.katehlcolor from archive (unpack it before!)
You can set you own colors and text style also in this menu
$HOME/.local/share/org.kde.syntax-highlighting/syntax/
Yup. That one works really well. Thanks to whomever does these plugins/extensions – I couldn't write a script if there were not colors on things.Just use VS Code, someone has made an extension with highlighting. Ain't got time to reinvent the wheel
echo "filetype on" >> ~/.vimrc
echo "syntax on" >> ~/.vimrc
/system/script/edit ([find]->0) source
## Syntax highlighting for Mikrotik routers
syntax mikrotik "\.rsc$"
#header "-\*-.*\<C(\+\+)?((;|[[:blank:]]).*)?-\*-"
magic "^# model = "
comment "#"
# commands
color green "^/.*"
color orange "^(add|set) "
# conditions
color blue "\[[^]][^]]*\]"
# Parameters - IP/MAC addresses
color bold,red "[^ ][^ ]*=([0-9]{1,3}\.){3}[0-9]{1,3}(/[0-9]{1,2})?"
color bold,red "[^ ][^ ]*=([0-9]{1,3}\.){3}[0-9]{1,3}-([0-9]{1,3}\.){3}[0-9]{1,3}"
color bold,red "[^ ][^ ]*=(([0-9A-F]{2}|XX|xx):){5}([0-9A-F]{2}|XX|xx)"
# Parameters - generic
color lagoon "[^ ][^ ]*=[^ "]*" "[^ ][^ ]*=\"[^"]*\""
# Comments
color pink "^#.*$"
color pink "comment=[^ "]*"
color pink "comment=\"[^"]*\""