Text editors and IDEs for Hugo

This is a discussion / support forum for the Hugo programming language by Kent Tessman. Hugo is a powerful programming language for making text games / interactive fiction with multimedia support.

Hugo download links: https://www.generalcoffee.com/hugo
Roody Yogurt's Hugo Blog: https://notdeadhugo.blogspot.com
The Hugor interpreter by RealNC: http://ifwiki.org/index.php/Hugor

Moderators: Ice Cream Jonsey, joltcountry

User avatar
Tdarcos
Posts: 9333
Joined: Fri May 16, 2008 9:25 am
Location: Arlington, Virginia
Contact:

Post by Tdarcos »

Roody_Yogurt wrote:We would have loved to have you, pinback. Maybe we can do another one soon enough.

(I still use EditPlus for 90% of my Hugo coding and only recently updated your original syntax file to include some more reserved words.)
I was using the IDE for FreeBasic because it was the only (free) one I knew of that had tabbed text editing, and most crucial for editing source code, line numbers (because that's how the compiler informs you where errors are). The IDE has bugs, you have to be careful not to use the close window button (the right hand x (close button) on the tab line) for a particlar file and only use the menu, because it sometimes crashes the IDE.

I tried using Eclipse but it was a bastard to work with (especially where you're editing files that use a non-standard extension ( .HUG ) and it doesn't know the language), and using Eclipse for this seems to make me think of using it this way is like "using nuclear weapons to kill flies."

I am now using Programmer's Notepad, and if you can figure out the tough-as-a-son-of-a-bitch XML code for the syntax highlighting functionality you can use it to edit Hugo code where it will highlight keywords. (It has templates for something like 20 different languages.) I'd gotten spoiled by CodeLobster's editor for PHP which does this plus a really important feature once you get used to it: Brace Highlighting. When your cursor is next to a brace, either to the immediate left or right of it, with Brace Highlighting, it highlights that brace and the brace it relates to (the opening brace above if you're at the closing one, and vice-versa below) which makes block errors easy to find since you can see if your brace points to the wrong corresponding one.

Hugo works fairly well in Programmer's Notepad with C/C++ as the syntax highlighter plus it gives you Brace Highlighting, a real plus. If EditPlus (is free and) has a decent syntax highlighter that can be programmed easier than writing an XML file plus Brace Highlighting I'd be interested.
Alan Francis wrote a book containing everything men understand about women. It consisted of 100 blank pages.

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

I recently revisited my survey of text editors. My current best suggestion for a free editor goes to Emerald Editor: http://www.emeraldeditor.com/

The syntax file is here: http://roody.gerynarsabode.org/emeraldhugo.zip (the readme inside explains where the files go)

Every text editor I looked at supported brace matching, so I ended up not even counting that in my comparison.

Besides doing Hugo comments correctly, I like the following about Emerald (Crimson) Editor:

-ability to set up templates
-project manager for grouping game files
-user tool configuration that lets you compile the current file you're working on with a click of the button

I don't like that I can't drag files onto it, but that seems to be a small price to pay.

User avatar
Ice Cream Jonsey
Posts: 28879
Joined: Sat Apr 27, 2002 2:44 pm
Location: Colorado
Contact:

Post by Ice Cream Jonsey »

I'll break this thread into one that is about IDEs and text editors.
the dark and gritty...Ice Cream Jonsey!

User avatar
Tdarcos
Posts: 9333
Joined: Fri May 16, 2008 9:25 am
Location: Arlington, Virginia
Contact:

Post by Tdarcos »

Roody_Yogurt wrote:I recently revisited my survey of text editors. My current best suggestion for a free editor goes to Emerald Editor: http://www.emeraldeditor.com/

The syntax file is here: http://roody.gerynarsabode.org/emeraldhugo.zip (the readme inside explains where the files go)

Every text editor I looked at supported brace matching, so I ended up not even counting that in my comparison.

Besides doing Hugo comments correctly, I like the following about Emerald (Crimson) Editor:

-ability to set up templates
-project manager for grouping game files
-user tool configuration that lets you compile the current file you're working on with a click of the button

I don't like that I can't drag files onto it, but that seems to be a small price to pay.
Tried it. Is not implementing the added syntax files you offered. Is not automatically implementing brace highlighting (Programmer's editor does this from the instant the file is loaded). PE has line numbering basically automatic; this Crimson Spring err I mean Crimson Editor you have to tell it to turn line numbers on (an extreme weakness since I presume every compiler uses line numbers to tell where an error in a document is located.) Not that good and PE does more.
Alan Francis wrote a book containing everything men understand about women. It consisted of 100 blank pages.

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

Huh, as long as the syntax files are in the right directories (the files in the link directory go to the installed link directory, the files in the spec directory go to the installed spec directory), it should detect Hugo files automatically. That said, there's a "Syntax Type" section of Preferences where you can point it to the right files by hand.

As far as brace-matching goes, you just have to go to Visuals in Preferences and check the "highlight matching pairs" box.

It's harder to believe that either of these things are more annoying than dealing with "tough-as-a-son-of-a-bitch XML code", but hey, if Programmer's Notebook handles Hugo's weird comments ok and you get the keyword setup going, more power to you.

PN does look like it has several features I like, including project management, text clips (been using this a lot in EditPlus for things like ASCII tables and Hugo color names), "find in files", and the ability to compile to window, so hey, good luck with that!

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

I made a syntax file today for the editor TextPad: http://roody.gerynarsabode.org/hbe/synt ... d/hugo.syn

Set-up:
Once Textpad (http://www.textpad.com) is installed, add the hugo.syn file to the system folder in the directory where TextPad has been installed. Open the program, go to Configure, select New Document Class, and make a class for Hugo with the proper extensions and select the Hugo syntax file when you get the chance. I think there's an option to turn on line numbering around there, too. After that, you'd probably want to go to the document classes tab in preferences, find Hugo, and change the keyword colors to whatever you want.

TextPad is technically shareware, but it's not crippled and the syntax highlighting works well enough. It does has some cons (besides not being technically free), though. It doesn't have proper project support and the built-in "compare files" thing is basically useless. Still, between the syntax highlighting and clip texts and things, it's not too shabby.

(Yeah, I'll probably keep on making syntax files for free text editors until I find one that I consider perfect)

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

Commander, if you are still using Programmer's Editor and have not yet tackled that syntax file problem, I have put one up here: http://roody.gerynarsabode.org/hbe/synt ... .schemedef (right click and "save link as").

It seems that making a proper .scheme file requires one to build their own version of the Scintilla file, so we are limited to .schemedef. Unfortunately, this means that there is no regular expression support, so line comments and multi-line comments can't coexist nicely. As I love multi-line comments, I compromised by making the single line identifier "! " instead of "!". Maybe getting in the habit of using two exclamation marks and changing the identifier to "!!" might be more reasonable.

User avatar
Ice Cream Jonsey
Posts: 28879
Joined: Sat Apr 27, 2002 2:44 pm
Location: Colorado
Contact:

Post by Ice Cream Jonsey »

I wanted to note what Roody told me in the mud yesterday because I will forget and I want to remember and use this in EditPlus2:

[Hugo]/009 Ellison says (to Recchi), "another nice thing you can do with EditPlus, btw, is use the Function List feature (under Search) to jump from routine to routine really quickly. you set it up in preferences under syntax and highlighting in the 'function patterns' button.

I have it look for

'^(routine|replace)' and '^(object|option|room|character|player_character|door|female_character|class|component|scenery|direction|remote_object|supercontainer)'"
the dark and gritty...Ice Cream Jonsey!

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

I also have various templates and clip text files at: http://roody.gerynarsabode.org/hbe/windows/editplus.zip

(They all go to the same Editplus folder in Window's Application Settings folder.)

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

I updated the EditPlus page on HbE to go into further depth about some of my favorite features: http://hugo.gerynarsabode.org/index.php?title=EditPlus

Hugellae

Post by Hugellae »

Roody, there's also an Emacs major-mode here:

http://www.plover.net/~ctate/hugo-mode.el

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

Thanks, Hugellae, we also have a link to that here: http://hugo.gerynarsabode.org/index.php ... ed_Editors

Hugellae

Post by Hugellae »

Roody,

Slightly OT, but I just realized I've got some random Hugo stuff I collected around 2001-2003 for the never-realized Hugonomicon. Stuff that no longer appears to be online(?)), such as the 2 issues of the Hugo newsletter, and some games/source not in the IF DB. Interested? Shoot me an email at cenazoic AT gmail.

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

Whoa, it is you. The last couple times you've posted, since your new handle has that extra "e", I figured you were one of the other regulars here cribbing off of your nick without being forthright about it (which even annoyed me but I wasn't going to make a big deal about it).

Anyhow, glad to have you around! I will definitely send you an e-mail for those files. Also, if you have any suggestions for ways HbE could be better, feel free to let us know (or even get an account and write some pages yourself).

Jizaboz's recent posting here shows that we could probably do a better job of explaining how to set up a nice compiling environment, but there's probably plenty of other stuff, too.

2011 saw the most Hugo games released in many years. Since most of the Hugo Comp games were released in 2012, we already have a good start, but here's to a handful more games being done before the year is out!

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

I got a request for a syntax file for Kate, an editor for KDE. I tried taking a look at creating a highlighting file myself, using http://docs.kde.org/stable/en/kde-basea ... ormat.html as a guide.

Unfortunately, I'd also like to have a ton of example files to look at, and it doesn't seem like you can download those without having the program installed, so I've given up for the meantime.

Still, if anyone wants to have their own go at it, here is a file with some keyword groups already defined (that part is a modified version of the gedit syntax file):
http://roody.gerynarsabode.org/JC/hugo_kate.xml (right click and select 'save as'- not a working xml file yet)

Everything else still needs work, though.

User avatar
Ice Cream Jonsey
Posts: 28879
Joined: Sat Apr 27, 2002 2:44 pm
Location: Colorado
Contact:

Post by Ice Cream Jonsey »

The Hugo Newsletter is linked-to from the Trotting Krips site. I think the URL is http://www.joltcountry.com/trottingkrips
the dark and gritty...Ice Cream Jonsey!

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

I saw that just earlier today (I was looking to see if, indeed, it was off the net). The JC version also has the benefit of having the original graphics. Anyhow, the moral of the story is, if you're going to do a newsletter, be sure to interview Jonsey.

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

Ice Cream Jonsey wrote:I wanted to note what Roody told me in the mud yesterday because I will forget and I want to remember and use this in EditPlus2:

[Hugo]/009 Ellison says (to Recchi), "another nice thing you can do with EditPlus, btw, is use the Function List feature (under Search) to jump from routine to routine really quickly. you set it up in preferences under syntax and highlighting in the 'function patterns' button.

I have it look for

'^(routine|replace)' and '^(object|option|room|character|player_character|door|female_character|class|component|scenery|direction|remote_object|supercontainer)'"
I just wanted to point out that while I split up the "function pattern" there for readability (even if I didn't balance them well), I recently figured out that splitting them up has been what has caused my function list sorting to be out of order from time to time. So, you are better off combining them into one super-pattern.

I guess that leave the other slot open for a completely different pattern.

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

Also, prompted by Cryptonomic's (Jeff Nyman's) tutorial ( http://www.joltcountry.com/phpBB2/viewtopic.php?t=2589 , the link is only available with the internet wayback machine), I checked out the editor Source Edit, which actually seems to be a pretty decent free editor (funny how a lot of the best editors to use with Hugo had their heyday nearly 10 years ago). Anyhow, I made a syntax file for it and added it to the "supported editors" page:

http://hugo.gerynarsabode.org/index.php ... ed_Editors

It only has one keyword group, but I don't find that as annoying as I thought I would and it even has a Function List option. So, nice.

Currently, my recommendations for free Windows editor would go like this:
  • TextPad (uncrippled shareware) - TextPad isn't perfect, but it's still being maintained and has some nice features, like being able to restrict spell-check to strings.
For people who don't even want the guilt of nagware, though, these are pretty good, too:
  • Source Edit - The options menu might be a little unkind to people unfamiliar with setting up an editor, but for the most part, Source Edit has some nice features, including that aforementioned function list feature.
  • Emerald Editor (sometimes known as Crimson Editor)- Getting multi-line comments to work on this was a headache, but now that that is done, Emerald Editor is tight little program. It has a crazy amount of possible keyword groups, and setting up basically consists of dropping the syntax files into the right directories.

User avatar
Jizaboz
Posts: 4811
Joined: Tue Jan 31, 2012 2:00 pm
Location: USA
Contact:

Post by Jizaboz »

Cool, I had wondered about this too. I most commonly use Gedit for both Linux and Windows.

Post Reply