Snippet Sidebar

Hi there!

Is there any package available for a custom snippet sidebar like in Komodo IDE?
Something like that:

Thanks for your help!
caom

I don’t know of any off the top of my head and a package search is a little tough since there’s quite a few language-specific snippets packages.

I don’t think that’s a thing, but I could see where it could be really useful.

Worth noting: it’s really easy to grab a list of all the available snippets. Just run the following JavaScript code in the console of Atom’s developer tools (ctrl-shift-i) to see all the choices you have in your current document.

atom.packages.getActivePackage('snippets').mainModule.getSnippets(atom.workspace.getActiveTextEditor())

If someone wanted to turn that into a dock item, it would be a piece of cake to push that data through an etch component. Maybe you could even make it filterable. The sky’s the limit in terms of features, but just a list is easy.

1 Like

When I was last testing custom snippets, per project, I found that a snippets.json file placed in the project root folder takes precedence over the ~/.atom/snippets.json.

I then use package project-viewer to define a list of projects then place custom snippets.json in each project root.

[Later edit]
As an after thought the package project-viewer can be used to create a group named Snippets. Then in the “Snippets group” create projects which link to custom snippets.json files to be edited brought together in one project spot in tree-viewer. This is close to a sidebar (as OP requested) but placed under Project-Viewer.

Thanks, checking our the project-viewer package. The Snippet functionality in Komodo als provides custom commands with placeholder that prompt a window with input fields. So I can use a media query snippet and type in the width in px. After that the snippet got inserted with the variables.

Also terminal/shell commands are possible (also with variables).

It would be nice to have it again :slight_smile:

I was assuming static (predefined) snippets.json which is easier than dynamic snippets.json. Extending the argument I imagine that a front end jquery script might be built to generate dynamic snippets.json to be placed in each project root location. Certainly at times I have applied php to generate dynamic js, css, svg and the same principle can apply to json and cson.

This warrants a bump to explain that I use the package modular-snippets to define custom snippets per project.

Just looking at the package README I am guessing that the package service might be modified there to launch a popup window to set snippet attributes to emulate the Komodo feature.