Smart triggers highlight!
And a little bit more...
Vim is a (very) powerful and flexible multi-platform text editor. Your humble servant spent nights trying to school it for triggers editing purposes. Let's see what came out of it:




Flashy-looking starcraft skin aside this thing has something considerable to oppose the other "advanced" text editors like Notepad++ and family. Let's look closer into it.
1.
Vim powerful syntax highlighting capabilities (in conjunction with my termendous patience) have made it possible to lexically recognize each syntactic piece of SCMD triggers scripts. You now shouldn't worry if you forget to put a semicolon or put a nasty space somewhere. The highlighting worries about it for you. It shows every single error that may make SCMD triggers fail at compilation time in red. Few examples:

Basically the following rule applies: if you see a red text SCMD wont't compile your triggers and vice versa. There are only three exceptions: 1) it still shows an opening curly brace in red if you have a line or more inbetween brace and trigger parameters, 2) it won't say anything when you exceed conditions or actions limit (16 and 64 respectively) and 3) most of numeric parameters in actions does not allow numbers which have a remainder 2^32-1 when divided on 2^32, the syntax only catches -1 and 2^32-1 as errors. The first one I am too lazy to fix

2.
Errors aside there are things which SCMD will allow at compilation time but which are in better case either meaningless or will produce "hidden" errors or unexpected behaviour. The highlighting gives warnings for those. Few examples:

No more comments, because there are endless possibilities for these kinds of warnings. Not gonna repeat the whole list, after typing them all manually into the syntax highlighting. There may be a few faults with unit warnings though, please report any inconsistencies you can find or additions you can think. I'll write the whole list of things which are recognised later some day.
3.
A careful reader could have noticed it highlights your strings with colors *exactly* how they will look in SC. The thing hides color symbols so you can see the string without them and also recognizes escape sequences and makes use of Vim conceal mechanism to represent them as a single symbol. Weird SCMD recognition of escape sequences makes it possible to define something like \xf3cE> which is good old white. It is also recognized.
...and even more, but I'm done listing all the good sides...
Installation
Let's move to the installation part. It was probably a good idea to chew and digest the whole thing like for babies... but not at the moment. Sorry.
Alright, it actually consists of 3 independent pieces. The first peice is the color scheme for vim which can be used independently. The second piece is the syntax highlighting file which does the main job and ties reconized syntax elements with predefined highlighting groups. So you can use it independently with the other possible color schemes. The third thing is a filetype plugin which defines a few mappings (type \trg to insert a trigger for example) and which supports the string preview highlighting.
The sequence of actions is as follows:
1. Get vim from link above.
2. Put the trigger.vim file from the syntax archive in $VIM/vimfiles/syntax (for me $VIM is C:/Program Files/Vim)
3. Put the trigger.vim file from the ftplugin archive in $VIM/vimfiles/ftplugin
4. Put the sc.vim file from colorscheme archive in $VIM/vimfiles/color
5. Run vim in easy mode (because normal mode will immediately kick your ass

6. Execute the command ":colorscheme sc" to change the color scheme. To execute the command from insert mode (which is default in easy mode) press Ctrl+O : and then type the command (already without ':').
7. Open a trigger file with extension .trigger and enjoy.
As was mentioned, you can use the provided highlighting with other color schemes. The string preview thing might look ugly with light backgrounds. You can disable it by typing a command :NoTrigStrPreview and enable later by :DoTrigStrPreview.
Well, this was a minimal info. I really hope it would suffice for you to install this. If not... well, ask questions in the thread and I will try to help. There are lots of things which left behind the scene and I am very sorry for such a poor description but this thing have really weared me out.

As a conclusion I am providing a few more pictures demonstrating the thing with the other color schemes:


Post has been edited 1 time(s), last time on Sep 2 2010, 4:02 pm by Wormer.
Some.