Atom Snippets for the Kirby Cheat Sheet

Today I finally got around to convert the Kirby Cheat Sheet to an Atom snippet collection. Since it’s not just a matter of “search and replace” because of the parameters and multiple bracket combinations, I had to manually go through almost 3000 lines of code. But I think it was worth it.

Many of us use Atom and wanted something like that for a long time. @judbd made a snippet collection with seven of the most used methods inside, but I wanted to include everything.

When coding with Kirby, I seem to open the Kirby Cheat Sheet every five minutes.

Now look at how productive that is:

Every suggestions displays a short description and a link to the corresponding page in the Kirby Cheat Sheet. I’ve added tabs stops for every parameter so you can simply hit tab and jump to the next parameter and eventually to the last closing bracket.

Here’s a link to the GitHub repository: https://github.com/medienbaecker/kirby-atom

If you find any errors, please add an issue. I’m sure I’ve overlooked something in all of these lines of code.

18 Likes

this makes me give atom another shot. I once installed it, but i could never seem to dump notepad++ for atom, as i was not used to play around with this.

1 Like

@thguenther can i delete this stuff?

# Your snippets
#
# Atom snippets allow you to enter a simple prefix in the editor and hit tab to
# expand the prefix into a larger code block with templated values.
#
# You can create a new snippet in this file by typing "snip" and then hitting
# tab.
#
# An example CoffeeScript snippet to expand log to console.log:
#
# '.source.coffee':
#   'Console log':
#     'prefix': 'log'
#     'body': 'console.log $1'
#
# Each scope (e.g. '.source.coffee' above) can only be declared once.
#
# This file uses CoffeeScript Object Notation (CSON).
# If you are unfamiliar with CSON, you can read more about it in the
# Atom Flight Manual:
# https://atom.io/docs/latest/using-atom-basic-customization#cson
1 Like

Yes. This is a example snippet :slight_smile: The ‘#’ means that the line is commented out.

2 Likes

Great work! Thank you!

1 Like

Lovely! Thank you @thguenther

1 Like

Okay, thanks you :slight_smile:

Too bad this is a .cson file and not simple .json, then you could also use this in Visual Studio Code. I don’t really like Atom :frowning:

I’ve added a json file for you: https://github.com/medienbaecker/kirby-atom/blob/master/snippets.json

Oh that was fast thank you :heart_eyes:! I will try to import that to VS Code.

Did the json work for Visual Studio Code or did you have adjust something? I’d add it to the repository then.

I had to delete 3 properties because they do not exist in VS-Code but they work yes. Not so charmingly good like that GIF shows it in the Atom editor tho ^.^

I created a Gist where I removed the properties. Maybe you can copy and past it and add it to your repo:

1 Like

Thanks a lot, I’ve updated the json file :heart:

Awesome, thanks for your work!

Wouldn’t that be better wrapped into an Atom plugin?

I have absolutely no idea how to wrap snippets into a plugin, but if you want to do that you can add a pull request to the repository.

I recently switched from Espresso to Atom so there’s still a lot to learn :sweat_smile:

i am still quite new to atom, but can this be turned into a package, so we can actually update it right from atom ??

2 Likes

Ahhhh this is so awesome, thank you!

2 Likes

Thanks to @Caleb this snippet collection is now an updatable package. You can now simply install it via the package manager in settings:

That way the snippets will always be up to date and you won’t have to paste anything in the snippets.cson everytime something changes.

6 Likes

This is just great :slight_smile:

6 posts were split to a new topic: Pros and cons of the Atom editor?