Jump to content

Atom grammar for KSP configs


Autochton

Recommended Posts

For those of you who use the Atom editor, I've made a grammar for KSP config files (as well as persistent-save files and craft files) and ModuleManager patches. It can be installed from inside the editor by the name of kerbal-config, or you may find the github repository here:

https://github.com/gertsonderby/kerbal-config

Pull requests, issue reports, scandalous photographs of prominent politicians in delicate situations, praise, banter and whatnot else you can think of is welcome.

Link to comment
Share on other sites

  • 9 months later...

I know this is a necro, guilty, but I feel bad about not seeing any posts in this thread saying thanks, and this is far and away one of the most useful and well done "mods" out there.

I can't tell you how many errors I've found with this tool alone (from myself and other modders:D). It got me into using Atom (and away from using Sublime, thanks for that alone!), which is pretty slick.

So thank you!:)

---

There are a few things I noticed it doesn't seem to handle for MM patches, namely :FIRST and :LAST (but those aren't actually listed on the wiki I don't think). Also, usage of "|" for OR makes it go white (which usually indicates bad). Only things I can remember off hand.

---

One of the big initial hurdles (besides actually figuring out how to get it installed, haha), was to get it to recognize KSP configs and automatically select the grammar. I had to add the below snippet to "config.cson" under the section "core:" and it works a treat. (Incidently, I also recommend using the Snippets feature). Highly recommended to everyone (as Atom is cross platform)!

Cheers.

 

    customFileTypes:
      "source.ksp-cfg": [
        "cfg"
      ]

 

Link to comment
Share on other sites

Thanks! It's always nice to get evidence that I'm not the only person to ever use a thing I made. ;-)

As for the file selection, I had trouble with that, myself, and ended up using the trick you mention. I wanted it to install the file types it supports (including craft and save files too), but I haven't gotten it working, and it's been a while since I really used it myself. (Really should get back to it, I have a mod I promised to maintain and haven't (u_u') ) But anyone who has suggestions or bug reports is welcome to raise them in issues, and anyone who feels they can solve something is, of course, welcome to open a pull request. I'll try to deal with them ASAP.

Especially, I'd be interested in possible snippets, since that is a really cool feature.

Link to comment
Share on other sites

So, I'm relatively new to even using Notepad++, and know NOTHING about Atom...

Are there any advantages to using Atom over Notepad++?

I DO notice that sometimes the formatting (tabs & spaces) I set in Notepad++ does not seem to always carry over into the .cfg, as I can open it with Notepad, WordPad, or even LibreOffice Writer, and it will not be cleanly formatted the way I had it in Notepad++...

Link to comment
Share on other sites

@Stone Blue I can only speak for myself, but what drew me to Atom in particular was the ease with which you can install add-ons. I even have a plugin that synchronizes my settings so I can have the same plugins on different machines. ;-) As well, I do most of my developing in JavaScript these days, and there's very good support for that. Atom is, in point of fact, itself written in JS (using Electron).

I haven't used Notepad++ in... fifteen years I think? A very long time, anyway. So for the actual differences between them, there you probably need someone else.

Link to comment
Share on other sites

  • 3 years later...
This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...