TextMate Bundle - Macro Syntax Highlight and Code Completion

Show off your RPG maps, campaigns, and tokens. Share your gaming experiences and stories under General Discussion and save this forum for things you've created that may help others run their own games. Use the subforums when appropriate.

Moderators: dorpond, trevor, Azhrei, Gamerdude

Post Reply
User avatar
wwmoraes
Kobold
Posts: 5
Joined: Sat Oct 24, 2015 11:22 am
Location: Netherlands
Contact:

TextMate Bundle - Macro Syntax Highlight and Code Completion

Post 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!
Attachments
MapTool.tmbundle.zip
MapTool Bundle for TextMate v1.0
(9.09 KiB) Downloaded 141 times
Toolbox "There is no dark side of the moon. Matter of fact, it is all dark."


User avatar
wwmoraes
Kobold
Posts: 5
Joined: Sat Oct 24, 2015 11:22 am
Location: Netherlands
Contact:

Re: TextMate Bundle - Macro Syntax Highlight and Code Comple

Post 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:
Toolbox "There is no dark side of the moon. Matter of fact, it is all dark."

User avatar
aliasmask
RPTools Team
Posts: 9023
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: TextMate Bundle - Macro Syntax Highlight and Code Comple

Post 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.

nirkedar
Cave Troll
Posts: 52
Joined: Tue Sep 21, 2010 3:13 pm

Re: TextMate Bundle - Macro Syntax Highlight and Code Comple

Post 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.

User avatar
Full Bleed
Demigod
Posts: 4736
Joined: Sun Feb 25, 2007 11:53 am
Location: FL

Re: TextMate Bundle - Macro Syntax Highlight and Code Comple

Post 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
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

maddog
Cave Troll
Posts: 30
Joined: Fri Aug 21, 2009 12:38 am

Re: TextMate Bundle - Macro Syntax Highlight and Code Completion

Post 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.
Attachments
mtmacro.zip
(3.49 KiB) Downloaded 62 times

Post Reply

Return to “User Creations”