Jump to content

New syntax editor


Miloch

Recommended Posts

I got a bit fed up with ConText and Crimson Editor. Nothing personal - they're both good tools but lack features I want. In particular, they don't seem to work well with certain international character sets - at least not on my computer.

 

So I found a free text editor I'm finally happy with - PSPad. I've even converted the ConText/Crimson TP2/BAF/TRA/D syntax highlighters on the G3 wiki to work with this tool. Just stick these files in your \PSPad\Syntax folder and (re)start the tool. It should automatically recognise and highlight the relevant files.

> WeiDU_BAF.INI

> WeiDU_DTRA.INI

> WeiDU_TP2.INI

 

In addition to what you'd expect, it has the following features:

> External compiler support

> Text difference comparison

> Hex editing

> Foreign language/unicode character support

> Text/HTML/CSS converters (quick and clean)

> Web browser/previewer

> Automatic formatting

> Automatic window arranging

> Spell checking in multiple languages

> Macro recorder

> Shell integration

 

Example: PSPad syntax highlighting

pspad1.gif

Link to comment

Hello i've just donwload PS pad who is really more "user friendly" and have many usefull options, he is better than ConTEXT.

My question is about the Highlighters : the ones for PS pad are not exactly the same as the Highlighters for Context. I tried copy the .chl categories Highlighters in the .ini but it wasn't detected... I'm used to the ConTEXT higlithers and i would like have exactly the same ones !!! If someone can help me resolve that little technical problem it would be great !

 

Here are the Context Highlighters categories

categoriescontext.jpg

 

Here are the PSPad Highlighters categories

categoriespspad.jpg

 

You can see that categories are not the same !

Link to comment
My question is about the Highlighters : the ones for PS pad are not exactly the same as the Highlighters for Context.
Well, I haven't updated these for over 2 years, and cmorgan has made changes to the ConTEXT filters. So someone would probably have to grab his most recent highlighters (probably more recent than his last update here a year and a half ago) and try to replicate them in PSPad.

 

This is pretty easy if you want to try it. Just go to Settings > User Highlighter and open the relevant INI file (such as WeiDU_TP2.INI). PSPad gives you 4 highlighting categories you can customise (these show up in the .ini as KeyWords, ReservedWords, KeyWords2 and KeyWords3). I think ConTEXT gives you 5 categories - that is the only difference that I can tell. PSPad highlights the current line, matched braces, right edge and selection automatically, though you can turn these off too (such as View > Active Line). You can also change the colours and fonts under Settings > Highlighters Settings (as in your screen shot).

 

So basically, this would just be a matter of matching the PSPad keywords to the ConTEXT/Crimson ones as closely as possible. Cmorgan gave more information on working with those filters here.

 

To be honest, I don't use these much anymore, since I've gotten somewhat used to reading WeiDU code. But I will say PSPad is still absolutely stellar for many things, like seeing text differences in two files. If you have two different versions of code, you can select both files, right-click > PSPad > PSPad TextDiff to see the differences quite easily. It is also a good with hex (binary code) and can structure and compress HTML and CSS, making it a great web page editor.

Link to comment

Hey, Miloch, does it allow for quicktext or autocompletion of code snippets?

 

Mike1072 had built a cool quicktext function set for NotePad++ that alowed you to type (for example

 

sgd

 

and hit a key turning it into

 

IF ~Global("TEXT","GLOBAL",#)~ THEN BEGIN statename

SAY ~TEXT~

IF ~~ THEN EXIT

END

 

and I have been puttering with the equivalent on Crimson and TextPad... does PSP do this? Because if it does I might want to make the switch, too.

Link to comment
Hey, Miloch, does it allow for quicktext or autocompletion of code snippets?
Apparently, it does as of 4.5.3. And scripting and a bunch of other stuff. I'm still using 4.5.2, but I downloaded the new version.

 

Have you made updates to your highlighters or is the version on the Tools page the latest?

Link to comment

OK thanks a lot for your answer Miloch, i'll try make some new .ini file with your new advices: it's exactly what you say :

PSPad gives you 4 highlighting categories you can customise (these show up in the .ini as KeyWords, ReservedWords, KeyWords2 and KeyWords3). I think ConTEXT gives you 5 categories
There is just one more categorie with most recent Highlighters for ConTEXT (as you can see in my screenshot too), but if PSPad allow only 4 categories... How about making 5 ? Can we ADD one more categorie in PSPad?
Link to comment
How about making 5 ? Can we ADD one more categorie in PSPad?
Not that I could see in 4.5.2 but there might be a way in the newer version. But do we really need 5 categories? I think we should just group them all into 4 categories with clearly defined labels. My eyes go funny with too many colours on the screen anyway :crazyeyes:. In these highlighters, I just kind of threw the commands into different categories arbitrarily without thinking about it too much. But maybe cmorgan has arranged them more intelligently in his newer highlighters.
Link to comment
How about making 5 ? Can we ADD one more categorie in PSPad?
Not that I could see in 4.5.2 but there might be a way in the newer version. But do we really need 5 categories? I think we should just group them all into 4 categories with clearly defined labels. My eyes go funny with too many colours on the screen anyway :crazyeyes:. In these highlighters, I just kind of threw the commands into different categories arbitrarily without thinking about it too much. But maybe cmorgan has arranged them more intelligently in his newer highlighters.

In the Notepad++ ones I'm currently using (and have sent to cmorgan), I tried to group things by their role in WeiDU (all patches in one category, actions in another, with modifiers to these commands [ie. GLOB, EQUIP] noticeably different) and the flow control commands (IF, FOR) being highlighted. I used all 4 of the groups in N++, but I didn't really need the last (just used it for fancy array highlighting). It has extra spots where you can specify comments, strings, brackets, and numbers though. I've been trying them out for a while and they're working well for my purposes.

 

Here's a comparison of old and new.

 

Notepad++ does have a few nice features that make it good for editing (the aforementioned code insertion is handy, and code folding is okay) but it has drawbacks as well. The regular expression search/replace unfortunately doesn't work on multiple lines unlike Textpad (non-regexp search/replace works fine), and while I was successful in setting up code completion (start typing and it'll start guessing), it seemed to cause random crashing, so I won't be using that feature until they fix it. Also, you often have to have whitespace between codewords for them to be recognised by N++ even when WeiDU doesn't require it (this is especially problematic in some block comments that appear to span lines that they don't), and code folding requires an additional marker be inserted at the end of each component, but both of these are only issues when viewing code written by others, they aren't a problem when writing your own.

 

I used to use Textpad, but now I use N++ for all my editing except mass regexp text manipulation and cutting/pasting things column-wise.

Link to comment

Mike1072's categories make sense - the raw data to recreate them is in the general workroom, but one summer project is to get them out. Unfortunately, NotePad++ versioned up just as we were playing with it, and I can confirm the random crashing with QuickText and autocompletion - the QuickText one I may have solved by a reinstall of he latest version.

 

I like lots of colors, so my favorite is still the Crimson Editor 7 category spread - but remember, that is because I work with dialog a good bit.

 

Currently, I switch to Crimson for dialog and column editing, TextPad for regexp search and multiple file/directory searches, use both ConTEXT and Crimson code snippets, and use NotePad++ with Mike1072's edits for .tp2/.tpa work. Then go to work and have to use a Mac, so I use a simplified bbcode highlighter with TextWrangler.

 

Heh. To create simple documents.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...