Manage text snippets

I use canned responses a lot. Instead of typing the same email 300 times, I just hit a few keys and the response gets slapped right into the email. I do this for anything I find myself writing more than once: technical questions, explanations, questionnaires for meetings, the answer to “what’s new with you?” and so on. There are bunch of tools for this, like TextExpander, AutoKey, and PhraseExpress. If you’re not doing this, you should.

I keep another set of notes in a different place1. These are meeting notes, web snippets2, that kind of thing. I use nvALT, an offshoot of Notational Velocity, but there are others like nvpy. I just type a few words, and nvALT finds every occurance of those words so I can easily find stuff again without having to dig around. Again, if you’re not using a tool like this, you should.

It’s annoying to have two different buckets for text. If I want to update a snippet, I have to remember where it is, switch to that application, and generally muck around until I find the thing I’m looking for. If it’s a really long snippet of text, I copy it from TextExpander to nvALT, edit it, and paste it back. Ohmygod, that’s annoying. So here’s the solution:

  1. Write the text in nvALT.
  2. Create a text snippet in your tool of choice, but instead of pasting the text from nvALT, create a shell script.
  3. The text of the shell script is:
    #!/bin/bash
    /bin/cat ~/Wherever/I/Keep/My/Notes/Note.md   
    
  4. Done.

Now I can update or edit the snippet alongside all the other text I manage, and the most current version will always appear when I use the shortcut.


  1. I write in markdown, which is really useful for drafting blog posts or whitepapers, because I can use the same text and shunt it into an email, an OpenDocument, or a web page. 
  2. Did you know you could paste a URL with ⌘-Shift-V, and have nvALT paste a markdown version of the web page? It’s boss. 

2 thoughts on “Manage text snippets

Comments are closed.