external editor syntax highlighting

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
n++_userdefined_routeros_rsc.zip (3.51 KB)

thanks for the highlighting, hopefully a lot of people will find it useful, also, maybe even some could add to your initial submission to improve it.

I use Textpad for the same thing - I’ve attached the syntax definition file I wrote for .rsc files.

t
textpad syntax file.zip (835 Bytes)

@dtoffo

Cool! Thanks!

-Greg

thanks ..

why not put your ros.xml on notepad++ wiki

SENZATEMPO

I didn’t find where to put it… can you tell me where or put it there yourself?

d

Thanks dtoffo for sharing! I took me a bit to figure out how to add it to Notepad++ amongst all the menus. In case anyone wants to know: Click View > User-Defined Dialogue > click Import button

Hi all…

may i know how to use this?

thanks.

  1. Download Notepad++: http://www.notepadplusplus.org
  2. Install Notepad++
  3. Download file above: http://forum.mikrotik.com/t/external-editor-syntax-highlighting/54626/1
  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.

Hi…
appreciated it and thanks a lot…

thanks…

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?

Any update is always appreciated.

Post it for us and put where you want: there’s no copyright nor any other restriction.
just I think it will be good to update this thread for anyone searching it on mikrotik forum

thanks

d

Here you go!
RouterOS-Syntax-Highlighter.rar (3.64 KB)

Is there plugin for Sublime Text 2? It’s a great editor.

I would really like to try this tool, but, I download Notepad++ and try to install the user defined .xml file here , but there is NO entry in the View Menu for User-defined dialouge…

THere are many many entries in that menu…just not THAT one…I am using ver 6.22


Am I missing something here…

It must have been moved in a new version…

Now it’s in Language > Define your language…
screen1.gif
or you can import it by going to Settings > Import > Import style theme(s)…
screen2.gif

I like the improvements! Cool :sunglasses:

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

[b]mkdir -p ~/.vim/syntax[/b]

and copy there “rsc.vim”, then edit

[b]~/.vim/scripts.vim[/b]

and add lines to let vim recognize them.
Just in case this is your first custom syntax file here’s the content for a minimal scripts.vim file:

[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]

Hope you’ll like it.
rsc.vim.tgz (4.43 KB)

I’ll throw my vote in for TextMate 2 or Sublime Text 2/3 … If anyone has done them yet.

-Eric

I wonder why the syntax check (and debugging) is not already implmented in ROS/WinBox…