Autocomplete Cheat Sheet for Espresso

Iā€™ve extracted all methods from the Cheat Sheet (camera, content, dimension, exif, field, file, files, language, location, page, pages, pagination, request, roots, site, camera, user and users) to create an Espresso autocomplete-plugin.

While itā€™s very useful to me itā€™s still very simple and wonā€™t suggest anything inside the parentheses. Iā€™m going to add that functionality in the future. Sadly itā€™s very time consuming to create something that saves time :sweat_smile:. Fortunately, a description of the methods is not necessary since they are so straight-forward and understandable.

Download it here: https://github.com/medienbaecker/kirby-sugar

3 Likes

Too bad Iā€™m using Atom :laughing:

Since Atom is so ā€œhackableā€ Iā€™m sure you can quickly convert it. In this file you can find the methods and use search and replace to change the surrounding tag.

Iā€™m using Sublime Text. Would be nice to have something like it there as well.

I just saw this one: https://packagecontrol.io/packages/Kirby2%20CMS%20Snippets
I donā€™t know if itā€™s up-to-date and complete, though.

Lol - Iā€™m using Rapid PHP and Visual Studio for web-developmentā€¦

Looks like all those snippets / auto-complete helpers are not standardized at all :stuck_out_tongue:

Iā€™ve tried to convert Bootstrap-snippets from Visual Studio to Rapid PHP, but that didnā€™t work out.

Brackets and Atom are another story as wellā€¦

Thanks!

It was updated 2015-09-07.

It did not work as good as I was hoping for. When doing this:

$page->titl

It finds $page->title(), so far so good. But when I hit enter it becomesā€¦

echo $page->$page->title()

Now I made this topic about the Sublime Text completion. Sorry about that.

No problem. I think it would be awesome to have the Cheat Sheet autocompletion across every text editor.

That doesnā€™t sound good, but I think you can easily edit it. Sublime Text is very straight-forward with these customizations. Have a look at the references regarding ā€œcompletionsā€.

Iā€™m not sure but I feel like it in theory would be possible to have some kind of script that goes through the functions and then by some rules adapt it to multiple text editors at once.

Maybe it would require a list of functions to not include the whole Kirby, but the rest seems doable.

Maybe it would take time, maybe itā€™s hard, but possible?

Iā€™m not the one for that project. I just looked in my Github and it looks like I have some plugins to maintain already. :wink:

Itā€™s actually not very complicated to extract the methods from each individual class. From there, it should be possible to get the information into the different formats, donā€™t know how complicated that is.

1 Like

Yes, itā€™s mostly a case of ā€œsearch and replaceā€.
Iā€™ve added a methods.txt to my repository, just take the methods from there.

I once created a Sublime autocomplete file for Kirby 1 (https://github.com/jakobploens/Kirby-CMS-Auto-completion-for-Sublime-Text-2), and I had the same issue with autocompletion. Here was one solution (not sure if this works or not, never tested it): https://github.com/jakobploens/Kirby-CMS-Auto-completion-for-Sublime-Text-2/issues/1