What Do You Use for a Code Snippet Tool?

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?

Well, I'm back to Quiver now, mainly because each Quiver Note can have multiple cells. I can first have a rich-text cell to document and provide links for the snippet, and then a code cell for the actual snippet.

The search in SnippetsLab is still superior, but the Quiver dev says he's working in improving Quiver Search, including adding Spotlight Search.

Bottom Line: Try both, and see which one works best for you.

Just updated my OP with my new approach.

2 Likes

I am a snippet amateur, but I am enjoying SnippetsLab a lot.

Folders, Smart Folders and tags help me feel like my snippets are organized. :slight_smile:

@JMichaelTX Thank you for so generously sharing your approaches and for innovating!

If I may ask a few questions, as today I started thinking about libraries and snippets to avoid trying to do again what I have done before :slight_smile:. And I came here and searched, and of course found the right thread.

This makes so much sense. Using software like SnippetsLap is interesting, but it is yet another tool to manage. Curious as to how do you send snippets into suitable storage files - meaning macro, script, shortcuts...

Evernote vs DevonThink - Have you evaluated? I am guessing you did. I had purchased Devonthink - the last version, but soon felt that it would be better to manage files in Finder itself and use spotlight etc. Evernote on the other hand is interesting because it creates a container oriented structure for documents where you can attach images and PDFs etc in a note.

So do you have flat tags or hierarchical tags? And when convenient, would love to hear how you assign tags (has to be frictionless :slight_smile: ), and if you leverage tags for filing etc as well.

Do you mean in file save dialogs?

Again, would be very interested in knowing how you organize these? Would be great if I can do it.

so do you use the script libraries in a standard and system wide location? And if so, how do you deal with version control as you may be tempted to change a function in a script library and that can break an earlier code?

I am sure you have shared this but I searched and did not find any.

Thank you again!

1 Like

I use SnippetsLab to keep code snippets/patterns.

And I use TeaCode to expand them out with token replacements.

Honestly, a FANTASTIC setup for me. So happy with both apps.

1 Like