Page 1 of 1

TextMate Bundle - Macro Syntax Highlight and Code Completion

Posted: Sat Oct 24, 2015 1:07 pm
by wwmoraes
Hello everyone,

I found myself helpless at the Mac side of the force regarding any decent tool to help me edit macros. :lol: I found in the forums some posts about Eclipse usage and even a plugin for Notepad++ that do highlight, but nothing for my beloved Apple. :oops:

Anyways, I’ve worked on a fully working TextMate bundle!
Image
If you want to help improve it, I’ve made a GitHub repository for it.

The Bundle
Spoiler
  • Syntax Highlight
Does recognize pretty much everything inside the macro tags (there’s some bugs with variables that does contain numbers, though)
  • Code Completion
It just completes anything you’re typing, and cycles through options (Macromates needs to implement a way to show a list of options)
  • HTML Markup Highlight
I’ve used the built-in HTML bundle from Macromates, so it doesn’t highlight macros inside HTML, like macros for in href attributes (maybe will support in a future version)
  • Supports dragging .mtmacro files, loading the macro contents
oh, just a small props 8) if you drag a .mtmacro file on TextMate, it will get the macro contents and put into the text area. You’ll have to select the file type to activate the highlight, as I haven’t found a way to set that :evil:
Grab your copy
Spoiler
You can get a copy of the bundle: Also, if you want to see the latest features without waiting a new release, just download the master branch zip, unzip, and add ".tmbundle" suffix in the folder name. Then follow the "How to install" section below!
How to install
Spoiler
Drop the .tmbundle file in the

Code: Select all

~/Library/Application Support/Avian/Bundles
directory (you can use Shift+Cmd+G and paste this path to go straight to it!), then open TextMate.

Also, AFAIK this bundle is supported by other editors, like Sublime Text, e-TextEditor and probably others that states to be "TextMate-compatible".
To-Do’s
Spoiler
  • Fix variable regex to match names with numbers aside commas (LOL :oops: )
  • Highlight macro commands inside HTML strings (e.g. href attributes)
  • Add drop support for other file types (rptok, rpcpmn, etc)
  • Automatically set the syntax type on drops
Happy macro’ing!

Re: TextMate Bundle - Macro Syntax Highlight and Code Comple

Posted: Sat Oct 24, 2015 3:11 pm
by wolph42
im not a mac user but thank you for sharing!!

Re: TextMate Bundle - Macro Syntax Highlight and Code Comple

Posted: Sat Oct 24, 2015 4:48 pm
by wwmoraes
Thank you!

And as I said, this bundle can be used in Sublime Text, which has a Windows version - so yeah, there’s some love here for you Windows’ users too :mrgreen:

Re: TextMate Bundle - Macro Syntax Highlight and Code Comple

Posted: Sat Oct 24, 2015 7:38 pm
by aliasmask
I was just checking out sublime text. One thing that interests me is the 64bit memory management. For really big files with syntax highlighting and code folding there can be some delay with npp++. Also, they changed how some of the syntax highlighting works with line comments which messes up the macro function header (no longer highlighted). I may have to check out sublime text and import your work. My current file for npp++ is starting to get out of date and needs a refresher or perhaps I'll go to a cross platform editor.

Re: TextMate Bundle - Macro Syntax Highlight and Code Comple

Posted: Sun Oct 25, 2015 3:17 am
by nirkedar
Wow. This looks like a lifesaver. However, I'm totally new to TextMate and I'm having trouble with installation.

I downloaded TextMate and dragged it over to my applications folder.
I created the ~Library.../Avian/Bundles folder (it does not exist) and dropped the MapTool.tmbundle file into it.
It did not show in my available TextMate bundles.

So I also tried by pasting it into the TextMate application folder (/Applications/TextMate.app/Contents/SharedSupport/Bundles/MapTool.tmbundle)
But it still does not show in my available TextMate bundles.

Any advice would be appreciated.

Re: TextMate Bundle - Macro Syntax Highlight and Code Comple

Posted: Sun Oct 25, 2015 6:47 pm
by Full Bleed
nirkedar wrote:Any advice would be appreciated.
Not on a Mac but found this in the instructions for another textmate bundle:
You can install this bundle in TextMate by opening the preferences and going to the bundles tab. After installation it will be automatically updated for you.
And then there is this (which might be your problem):

http://textmate.1073791.n5.nabble.com/T ... 17936.html

Re: TextMate Bundle - Macro Syntax Highlight and Code Completion

Posted: Tue Mar 30, 2021 2:34 pm
by maddog
As I don't use MacOS anymore, I used Atom's built-in converter to make a syntax plugin for Atom. I took your TextMate plugin and whacked that.

The steps I followed:

Code: Select all

apm init --package mtmacro --convert <path to the MapTool.tmbundle>
(You can also apparently link directly to the github location of the bundle.)

For those content to simply download the Atom version, you'll need to

Code: Select all

apm link mtmacro
and restart Atom to get it to work.