XYS Syntax Highlighting/Autocomplete for Akelpad [XY v24.60]

Discuss and share scripts and script files...
FluxTorpedoe
Posts: 855
Joined: 05 Oct 2011 13:15

Re: XYS Syntax Highlighting/Autocomp. for Akelpad [XY v15.50

Post by FluxTorpedoe »

SammaySarkar wrote:hey, a small bug: in a string like this "test()", the inner text is hilited as a function.
Indeed! I'd noticed and fixed it but was off too often to remember posting the update… :oops:

So here it is, on par with v15.50 (and only minor enhancements).

---------------------------
highend wrote:So Akelpad is superior over Notepad++? Never used any of them :/
SammaySarkar wrote:AkelPad is very fast, but quit advanced too.
Ditto!

My goal when going on a crusade for editors and trying pretty much all of them, was to find a soft that would:
— be featured enough for system/coding interventions (i.e. regex, syntax highlight)
— be light and fast enough to replace notepad for everyday use

i.e. What's THE tool that can be used all day long to open any txt/ini/reg/html/css/xys/etc. with a bit more than what Metapad has to offer but nearly as fast?

=> It's easy to find lots of editors that match the first criterion — and which do it more thoroughly than Akelpad (better regex interface, snippets, etc.).
But (to my knowledge) not a single one comes close in terms of speed.

So ofc it's not meant to replace a full-time developer's editor/environment, but for general use, coding intervention, scripting…, it's pretty much ideal!

FluxTorpedoe
Posts: 855
Joined: 05 Oct 2011 13:15

Re: XYS Syntax Highlighting/Autocomp. for Akelpad [XY v15.60

Post by FluxTorpedoe »

Updated to XYplorer v15.60 (see first post)

And to think that —in keeping up to date with XYplorer— I'm lagging far behind my highlighting/autocomplete for Akelpad!… :veryconfused:

---------------------------
SammaySarkar wrote:you might consider put it in github (like binocular's SublimeText syntax), so others can pester you with updates! :kidding:
Hehe… Long overdue answer: If only I had enough free online-time!

Anyhow, hope some of you find it useful. Now I've got to go back and check what has happened during the last few weeks!

Have a nice day, 8)
Flux

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: XYS Syntax Highlighting/Autocomp. for Akelpad [XY v15.60

Post by bdeshi »

updated :tup: 's!

This is more than useful. It's essential.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

klownboy
Posts: 4109
Joined: 28 Feb 2012 19:27

Re: XYS Syntax Highlighting/Autocomp. for Akelpad [XY v15.60

Post by klownboy »

Many thanks here too Flux. I must say I'm really starting to like AkelPad especially with your syntax highlighting. I finally figured out some of the options. One thing that was driving me nuts, I finally fixed, was when I clicked outside and to the right of a line, the marker position would stay at that location and not go to the actual end of that line. Now it does. :roll:
Thanks again.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

FluxTorpedoe
Posts: 855
Joined: 05 Oct 2011 13:15

Re: XYS Syntax Highlighting/Autocomp. for Akelpad [XY v15.60

Post by FluxTorpedoe »

Thanks for the feedback guys!
klownboy wrote:when I clicked outside and to the right of a line, the marker position would stay at that location
Yeah, the "caret after end of line" Editor option… Never figured out (yet) what would be the benefit.
OTOH, I really like the ALT+"Click and drag" to make vertical selections, even after end of line (though it’s not specific to Akelpad).

FluxTorpedoe
Posts: 855
Joined: 05 Oct 2011 13:15

Re: XYS Syntax Highlighting/Autocomp. for Akelpad [XY v15.90

Post by FluxTorpedoe »

Updated to XYplorer v15.90 (see first post)

Everything from v15.90, still with most undocumented (but useful) commands, plus:
! few :bug:
+ list of switches for quicksearch
+ list of available settings to adjust for setting
* old end shortcut for "end 1;" is now renamed end1 and old "regular" end() is now just end (more logical)
* rearranged and expanded various rem shortcuts for quick entry of remark separators

Have a nice day, 8)
Flux

klownboy
Posts: 4109
Joined: 28 Feb 2012 19:27

Re: XYS Syntax Highlighting/Autocomp. for Akelpad [XY v15.90

Post by klownboy »

Thanks Flux for keeping on top of Akelpad highlighting. :appl:
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

Papoulka
Posts: 455
Joined: 13 Jul 2013 23:41

Re: XYS Syntax Highlighting/Autocomp. for Akelpad [XY v15.90

Post by Papoulka »

Flux, thanks for putting together this (huge!) syntax file. That motivated me to try this editor. Being new to it I had a little trouble getting the highlighting to work. Here's what succeeded:

#) Looked at the manual. My eyeballs locked up.
#) Placed xys.coder in folder AkelPad\AkelFiles\Plugs\Coder
#) In Options | Plugins - enable
Coder::Highlight
Coder::CodeFold
Coder::AutoComplete
#) In Options | Plugins call (cannot directly enable) Coder::Settings
#) In Coder::Settings | Highlight enable "Auto Selection Marking - Words"
#) Close Akelpad
#) In folder AkelPad\AkelFiles\Plugs\Coder delete the "cache" file
# ) Restart Akelpad
#) Load a .xys file and syntax highlighting should work...

Removing the cache file was crucial; that tip was here: http://akelpad.sourceforge.net/forum/vi ... oder#21121

The highlighting is very good! I'll see how everything else goes...

FluxTorpedoe
Posts: 855
Joined: 05 Oct 2011 13:15

Re: XYS Syntax Highlighting/Autocomp. for Akelpad [XY v15.90

Post by FluxTorpedoe »

@all
Thanks for the feedback!
A ~ two year old :bug: has slipped: open() ending with 2 ";;" (thanks SammaySarkar for noticing).
Will fix in next update.

@Papoulka
Yep, Akelpad initial setup isn’t very user friendly! And it seems you’ve run into some extra problems… Thanks for pointing out the potential cache issue and especially for detailing your procedure! It gave me the incentive to enhance it for newcomers using a fresh Akelpad.

@all
Here’s a basic “ideal” setup of Akelpad for XYplorer:

• Setup:
1) Copy "xys.coder" in folder "AkelPad\AkelFiles\Plugs\Coder"
2) Copy your favorite font (e.g. LiberationMono-Regular.ttf / -Bold / -Italic) in "AkelPad\AkelFiles\Plugs\Fonts"
3) Run Akelpad
4) In Options | Settings… | Registry > Check "INI file" to make it portable
5) In Options | Plugins… > Check those entries:
   ------------------------------------
   — Coder::AutoComplete
   — Coder::CodeFold
   — Coder::Highlight
   — …
   — ContextMenu::Main
   — …
   — Fonts::Main
   — …
   — LineBoard::Main
   — …
   — QSearch::QSearch    (which I assigned to Alt+F3)
   — …
   — ToolBar::Main
   — …
   — XBrackets::Main
   ------------------------------------

6) Restart Akelpad

• Optional:
#) Adjust your plugin settings in Menu Plugins
#) Adjust your color theme (Toolbar: 2nd row, 5th button)
#) To add an XYS entry to the list of Syntax Themes (and/or edit the list):
      — Click on the Syntax Themes button (2nd row, 4th button), which opens a dropdown menu
      — CTRL+Click on "XML", which opens a "ContextMenu plugin" window
      — Insert the following line below the (currently selected) XML entry:
          "XY Script" Call("Coder::Settings", 1, "xys")
#) To add an XYplorer toolbar button that runs the current (saved) script directly from Akelpad:
      — Copy the following line after editing your XYplorer path (change "XYPath\" to the relative path e.g. "..\XYplorer\", or absolute e.g. "C:\XYplorer\")
          "XYplorer..." Exec('"%a\XYPath\XYplorer.exe" /flg=2 /script="%f"') Icon("%a\XYPath\XYplorer.exe")
      — Right-Click on the toolbar, which opens a "ToolBar plugin" window
      — Paste the copied line at the end of the menu

Hopefully, the other steps shouldn’t be necessary with a fresh install.

Hope this helps, 8)
Flux

---------------------------
EDIT: Revised and added the toolbar button tip. Last tips contributed by SammaySarkar.
Last edited by FluxTorpedoe on 15 Nov 2015 21:56, edited 1 time in total.

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: XYS Syntax Highlighting/Autocomp. for Akelpad [XY v15.90

Post by bdeshi »

# opt.) To edit the list of Syntax Themes and/or add an XYS entry (Toolbar: 2nd row, 4th button):
In Options | Settings… > Double click on ContextMenu::Main > ContextMenu::ShowMenu >
Scroll at the bottom of "SYNTAXTHEME" list, and between "XML…" and "SEPARATOR1" paste:
"XY Script" Call("Coder::Settings", 1, "xys")
Or a quick shortcut: open the syntax menu, and ctrl-click on XML. :ugeek:

by the way, I also have a small toolbar button for running scripts right from AkelPad (the toolbar plugin is enabled)
* right click the toolbar, if the selected text in the opened dialog is indented, then find the next "UNSET(<some flag>)" line and make a new line after that, and paste this in (adjust xyplorer path)

Code: Select all

"XYplorer..." Exec('"%a\..\XYplorer\XYplorer.exe" /flg=2 /script="%f"') Icon("%a\..\XYplorer\XYplorer.exe")
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: XYS Syntax Highlighting/Autocomp. for Akelpad [XY v15.90

Post by highend »

# opt.) To edit the list of Syntax Themes and/or add an XYS entry (Toolbar: 2nd row, 4th button):
In Options | Settings… > Double click on ContextMenu::Main > ContextMenu::ShowMenu >
Scroll at the bottom of "SYNTAXTHEME" list, and between "XML…" and "SEPARATOR1" paste:
"XY Script" Call("Coder::Settings", 1, "xys")
It's Options | Plug-ins...
instead of
Options | Settings...

Right?
One of my scripts helped you out? Please donate via Paypal

FluxTorpedoe
Posts: 855
Joined: 05 Oct 2011 13:15

Re: XYS Syntax Highlighting/Autocomp. for Akelpad [XY v15.90

Post by FluxTorpedoe »

SammaySarkar wrote:It's Options | Plug-ins... […] Right?
Yep, indeed! Thanks.
BTW, I’m 60+ posts late, but congrats on your 3k! :appl:
SammaySarkar wrote:Or a quick shortcut: open the syntax menu, and ctrl-click on XML. by the way, I also have a small toolbar button for running scripts right from AkelPad (the toolbar plugin is enabled)
Cool trick for the menu, and more reliable for this "how-to" (no risk of opening another menu). I replaced my entry with yours in my post.

Regarding the toolbar button: Just terrific! :D
I added this tip too if you don’t mind. I shall move the whole procedure to the first post when I have a moment.

I never took the time to investigate there… I just tried to make another XY button, to run a selected portion of code as a script (as opposed to the whole saved file), but no luck. I couldn’t find a way to pass "\s" externally… If you have an idea, that would make a nice addition I guess!

Well, thanks both of you for helping!

Have a nice day, 8)
Flux

Papoulka
Posts: 455
Joined: 13 Jul 2013 23:41

Re: XYS Syntax Highlighting/Autocomp. for Akelpad [XY v15.90

Post by Papoulka »

Akelpad is working out well for XY scripting. Thanks again Flux, and thanks Sammay for the toolbar button which really helps integrate things.

One question... XY scripts need at least one space of indent on all except the first line. When I edit, Akelpad often loses that space. Now I assume that Akelpad (like UltraEdit, for example) has a function somewhere to maintain indents, as that is common in coding.

So, has anyone found out how to enable that?

Thanks

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: XYS Syntax Highlighting/Autocomp. for Akelpad [XY v15.90

Post by bdeshi »

options > keep left spaces
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Papoulka
Posts: 455
Joined: 13 Jul 2013 23:41

Re: XYS Syntax Highlighting/Autocomp. for Akelpad [XY v15.90

Post by Papoulka »

Got it, thanks. It was so obvious I overlooked it. Not buried deep enough in Plugins | Settings etc etc :?

Post Reply