Recently I’m working in a very restricted Windows environment, and so I needed a portable text editor that requires no installation (as I don’t have the permissions to add softwares to the system).
My favourite so far was the portable edition of Gvim (linux users know what I’m talking about). But today I found PSPad - a really handy editor with tons of features. The best in these editors is that you can add syntax highlighting rules, and then you can use them to write code in less known languages (e.g GAMS).
Update 4: Many thanks to Henry who sent me his own gams.vim and so helped me to inprove the syntax file. Based on his version, I was able to add some new features. Follow the development on github.
Update 3: I’ve transferred the project to github:
http://github.com/trialsolution/gamsvim
Update 2: The code was reviewed and uploaded to vim.org. Please find it here:
http://www.vim.org/scripts/script.php?script_id=3127
Update 1: I found it in an old post but I post it because I was looking for a good line wrap setting for gvim for quite some time. To set a nice word wrapping in gvim:
:set wrap linebreak textwidth=0
You can find my GAMS syntax files for these two applications below. Feel free to modify it if you like.
1. Syntax file for gvim. Instructions: simply save the code as ‘gams.vim’ and place it into the
\GVimPortable\App\vim\vim71\syntax
folder
2. Syntax file for PSPad. Save the code as ‘GAMS.ini’ in the ‘\pspad\syntax’ folder, then you can configure the colors in the ‘Settings\Highlighters settings’ menu.
;PSPad user HighLighter definition file
[Settings]
Name=GAMS
HTMLGroup=0
Label=1
FileType=.gms,.lst
CommentString=*
PocoComment=1
2StarsComment=1
IndentChar={
UnIndentChar=}
TabWidth=4
SingleQuote=1
DoubleQuote=1
KeyWordChars=-_$
CodeExplorer=ftUnknown
[KeyWords]
ABS=
acos=
acosh=
Alias=
asin=
asinh=
atan=
atan2=
atanh=
ceil=
cos=
cosh=
ctime=
display=
div=
Equations=
equations=
exp=
floor=
log=
log10=
max=
min=
Model=
option=
Parameter=
Parameters=
precision=
round=
Scalar=
Set=
sets=
sin=
sinh=
Solve=
sqrt=
Table=
tables=
tan=
tanh=
time=
trunc=
uniform=
Variable=
variables=
[ReservedWords]
[KeyWords2]
abort=
By=
Downto=
else=
Elseif=
file=
for=
if=
loop=
put=
putclose=
repeat=
to=
until=
while=
xxpto=
[KeyWords3]
$call=
$eval=
$if not=
$include=
$option=