What Do You Use for a Code Snippet Tool?

I'm currently using three "tools", which is NOT a good idea:

  • Snippet folder on my Mac
  • Evernote (does NOT properly maintain code format)
  • TextExpander (easy access, but not really suitable)

So, I'm looking for a new Snippet tool to consolidate.
Here's one I'm considering:
Quiver -- Programmers Notebook App

I like it because it goes well beyond a simple snippet library, offering ares to enter text, images, links, etc.

BTW, I haven't found anything that would really work well with KM, like storing a group of Actions that I often use. Any ideas?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

UPDATED: 2019-05-19 14:41 GMT-5

Well, it has now been 4 years since I made my OP, and much has changed.

  • I no longer use any of the above tools to manage my code/script snippets
    • I do continue to use Evernote to store and search for documentation of all types
  • My primary tool is storing all scripts as .scpt files, and using Finder Tags
    • Finder Tags provide a very powerful and easy to use Spotlight Search, both normal and search in the Finder.
    • The Finder provides a nice dropdown list of my tags when I save a file, and when I search for a file.
  • I also use Typinator to provide my most commonly used snippets
  • All of my standard functions/handlers are in Script Libraries, easily called from any script
  • I have a KM macro and script that allows me to easily search my Script Libraries, and insert either a call to the handler/function, or insert the full code of it.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

What snippet tool works best for you?

2 Likes

CodeBox is text-only, but I find it useful.

( and it can handle non-text assets as links – local or web )

http://shpakovski.com/codebox/hidden-features

1 Like

Thanks, Rob. The feature list is quite impressive. I'm going to check it out.

Dash seems to be popular (but I guess it’s only for code snippets).

https://kapeli.com/dash

Thanks. Dash looks awesome. I especially like the API documentation browser. Have downloaded trial for testing.

Re: CodeBox

Thanks for the suggestion, Rob.

At first it looked like a great snippet manager, based on the web product page screenshots and feature list. But then . . .

Maybe I'm doing something wrong, but the syntax highlighting seems flaky to me.
I pasted in some AppleScript code that has a main script and handlers.
It treated the handlers like comments.

As far as I can tell, CodeBox has very little documentation -- just the two web pages.
I don't see anyway to change the syntax highlight scheme.

Am I missing something obvious?

Thanks for any tips.

Example:

I personally don’t switch on its Applescript syntax colouring – I have it on the plain text setting – my main use is for:

  • pasting and labelling functions and snippets,
  • finding and copying them at a later date
  • pasting them into a code editor (where, of course, I do find syntax highlighting useful).

For syntax reference I use Dash, and hadn’t noticed that it had a user snippet archiving function.
I’ll personally stick with CodeBox for storage and retrieval of my own code, but perhaps mainly for lack of an incentive to move things.

If you are starting function/snippet storage afresh - it’s possible that Dash would work better, but I’m not well placed to comment - I haven’t really looked at that aspect of it.

Good point about syntax highlighting.

I've been extensively testing CodeBox, Dash, and Quiver for several days now.
At this point, Dash seems better, but is still missing some stuff I really need, like a Snippet Title field that is NOT the Snippet expansion code.

I do really like the syntax ref, document lookup that Dash provides. The fact that it goes directly to the search term in the document is very helpful, unlike a google search that returns the document (like AppleScript Guidelines doc), but the actual thing I'm looking for is buried in the doc.

Thanks for sharing your thoughts and experience.

I like Dash, but I think the snippets manager section needs improvement.

I sent the Dash developer an email with some enhancement requests, and his reply was positive. Looks like he is working on a major upgrade for the snippets manager.

My my email and his response:


###From: Kapeli support@kapeli.com
Date: Sat, Aug 1, 2015 at 12:51 AM
###Subject: Re: Dash Enhancement Request (ER) for Title field

Hi JMichaelTX,

Is there any chance you could work this change in any time soon?

Nope, sorry. I plan on revamping the snippets features completely, so all of the features will come at once.

Regards,
Bogdan


On 01 Aug 2015, at 02:21, JMichaelTX wrote:

Bogdan,

Thanks for the reply.

Although all of the below ERs would be really helpful, I feel like #1, Title field, is essential.
I must be able to give the snippet a friendly, readable Title, while having, or not having, a snippet expansion code.

Is there any chance you could work this change in any time soon?

Many thanks.


From: Kapeli support@kapeli.com
Date: Wed, Jul 29, 2015 at 4:35 PM
###Subject: Re: Dash Enhancement Request (ER)

Hi JMichaelTX,

###Most of these features are planned, but I'm not sure when I'll get to them.

Sorry for the inconvenience!

Regards,
Bogdan


On 29 Jul 2015, at 23:45, JMichaelTX wrote:

Hi. I really like Dash, especially the API doc browser.

###However, I really need two more fields for the Snippet form:

  1. Title — separate from the Snippet Appreciation
  2. Rich text block where I can:
    -- Describe the snippet and document references
    -- Include rich-text hyperlinks (not just the URL)
    ###Also, two date fields would be very helpful:
    -- Date Created
    -- Date Updated
    ###Finally, I need a more selective Search engine, so that I could limit the search by these fields:
  1. Language
  2. Tags (including excluding tags)
  3. Words in the Title (include or exclude)
  4. Date Created range
  5. Date Updated range
  6. Snippet Appreciation (expansion text)

Thanks.

Just noticed that Quiver is on sale for $1.99 in the Mac App Store. https://itunes.apple.com/us/app/quiver-programmers-notebook/id866773894?mt=12

1 Like

That's a real steal for a great snippet tool, which is also a general purpose programmers notebook. See

If you wish to try yet another tool, I can recommend aText at $4.99. It has an amazing range of options (especially in the insert department), and I use it daily (see image), though I don’t use the snippet in the image … it was only to show some of the options.

What’s wrong with a text expansion tool such as Typinator? (I forget if TextExpander can handle pictures, formatted text, and html, but Typinator can.) What are your criteria for a good clippings manager?

Scale :slight_smile:

I typically need to paste about three functions at a time, in unpredictable combinations.

With Quiver plus a KM-launched script (which keeps MRU memory in a KM variable), I can do that in parallel with multiple selections.

Single selections I can jump to directly with the initial character(s) matching property of a select from list control.

Typinator has its role for some boilerplate insertions, but is less well matched to frequent and multiple selections from a library of functions. 100+ mnemonics gets unwieldy.

I actually used Quiver before but now use SnippetsLab as I find it much better than Quiver both aesthetically and functionally. I only keep code snippets in there with comments. It looks something like this.

The best thing is that it has a native alfred search and I can instantly find the note I need. I tried to like Quiver and used it for a bit but really do find SnippetsLab much better for that sort of thing.

1 Like

Thanks for sharing your review on SnippetsLab. I had not heard of it. From my quick review, it does look interesting. I may have to check it out.

Yep, SnippetsLab looks good, too. Unfortunately no trial.

A downside I see: There are no (concrete) plans for iOS.

@nikivi, what exactly do you like better with SnippetsLab (functionally)?

I love the idea of cells in Quiver but I found there was a certain lag when switching between the cells and going to the cell that I needed quickly. For a code snippet manager, I need good organisation capability, easily adding snippets to the section I want, ability to add notes and comments, very quick retrieval of snippets. The quick retrieval of snippets is instantaneous with the Alfred workflow that developer provides with SnippetsLab. Plus the application looks a LOT better than Quiver. I am very keyboard centric person and I very much dislike having UI that I do not use be in the app and Quiver had a lot of that, I contacted the developer and he had no intention of changing it. SnippetsLab feels a lot faster has great language support, has a thing with fragments where you can split a snippet into different parts with corresponding notes. It just feels much better to use.

If you are interested, I have made a list of all the top applications / workflows / safari extensions that I use on my laptop. SnippetsLab is one of the top on there. :slight_smile:

1 Like

Thanks for the details.

I just went through the online documentation. The smart groups thingy can be very convenient, I imagine.

If you are interested, I have made a list of all the top applications / workflows / safari extensions that I use on my laptop.

Seems interesting. I will read through it in the next days.

I have such a list (currently only Mac apps), too :slight_smile: Go here.

1 Like

SnippetsLab

@nikivi, thanks again for your detailed review of SnippetsLab.

At first I was very satisfied with Quiver. But now that I have 400+ Notes/Snippets in Quiver, I am finding the search facility to be lacking. And, there is no built-in means to copy/paste a snippet into another app (although that would be easy to create in KM).

As I understand it (not having used it), the Alfred workflow for SnippetsLab should work easily with other tools (KM, AppleScript, etc), since it is simply based on a custom URL scheme.

But what has really impressed me about SnippetsLab, are its Smart Groups, and the same basic syntax that can be used i a general search/filter. This is not available in Quiver.

I'm giving serious thought to buying it, since it is only $10.

Anyone else have comments on SnippetsLab?