zw

My Notes Workflow

I live in plain text. I keep all my thoughts and notes in simple text files. I know there are plenty of apps out there like Yojimbo, VoodooPad, and Evernote that provide advanced features, like storing images and video, but I like the simplicity of plain text. It’s small, it’s efficient, cross-platform, and I don’t have to worry about being locked into some proprietary format. I can use any number of UNIX tools like grep to search the files, or write scripts to process the data in some other way. Also, I’m writing code all day anyway, so it makes sense to be able to use the same tools to edit these files.

The System

The simplest (and original) version of this system is just a folder with a bunch of different text files in it. In this version, I just used TextMate for editing the files. This got an upgrade when Dropbox came out. Then the folder was stored on Dropbox, which gave me automatic backup and syncing to all my computers. A few months ago, I discovered Notational Velocity which gave me a nice front-end for quickly searching, opening, and editing the files. Notational Velocity is a great little app that is really fast, and makes it simple to store it’s files on Dropbox as well. One thing NV is lacking is Markdown highlighting, which seems to be a much requested feature, so hopefully it will get it sooner or later. The only missing piece is access from my iPhone and iPad. Enter Simplenote. Simplenote will store your notes in the cloud, and has apps for the iPhone and iPad that automatically sync with it. The glue that makes this all work is that Notational Velocity has built-in support for syncing with Simplenote. So now I have read/write access to all these files wherever I am. If you don’t want to use Simplenote, you can use the just released Elements app for the iPhone/iPad that can edit text files stored in Dropbox. I haven’t tried it yet, but looks like a nice app, and simplifies things a bit.

That’s great, what’s it for?

Pretty much everything. The draft for this blog post, for one. All the different ideas I have for projects, apps, startups, blog posts, etc. Lists of songs/movies/books I want to download/watch/read. Snippets of code that don’t really belong in TextMate, and complex terminal commands I can never remember. And all the other kinds of little bits of information that have no where else to go, like serial numbers. I usually write everything in Markdown, which is a perfect format for these kind of files. Easily readable as plain text, but also can be converted to HTML if need be. I’ve tried a lot of different ways to keep track of these kind of things in the past, but the thing that makes it work is having access from anywhere. Jotting down thoughts in a Moleskine is fine until you don’t have it with you, or need to search for something. I’m always near my computer, iPhone, or iPad - ubiquity is key.

Room for Improvement

I’ve thought about using git for version control, but I don’t really see much of a need for it right now. It might be nice to store everything in git, so I can always see the revisions I’ve made. Plus, then I can store a copy on my Slicehost server, and update the files via SSH if need be. But this seems a little overly complex. I don’t want to worry about committing and pushing every time I update a file. I like the simplicity that right now, I hit save and it’s automatically synced to Dropbox and available everywhere.

The one other feature that would be nice is linking between files, like a wiki. I need to find a way to work it in without requiring any sort of external metadata. I’m thinking another Markdown tag, like [[double brackets]](filename.txt) that points to another file. Notational Velocity, or another app, would then need to understand and interpret these internal links. If the app doesn’t understand them, it’s still clear what the purpose is, so we’ll say it degrades gracefully.

Using Dropbox to sync TextMate

I use TextMate at both home and work for doing all my development and for dealing with pretty much anything text related. I got tired of having inconsistent environments between work and home. I wanted to be able to create a new snippet at work and be able to use it at home (and vice versa) without having to recreate it. Turns out you can do this easily with Dropbox.

Dropbox1 is a service to sync files across multiple computers and to the cloud, and It’s free to use with 2GB of storage. It makes it dead simple to keep files in sync and you can access those files from the web as well. All you have to do is store your TextMate specific files in your Dropbox account, and then point TextMate to use those files.

  1. 1. Quit TextMate if you have it running

  2. 2. Move the ~/Library/Application Support/TextMate folder to your Dropbox

  3. 3. Open up Terminal and create a symbolic link from your ~/Dropbox/TextMate folder to your ~/Library/Application Support folder:

  4. $ ln -s ~/Dropbox/TextMate ~/Library/Application\ Support/TextMate
  5. 4. Repeat steps 1-3 on all the computers you want to sync.

Now any changes you make to your TextMate bundles on any computer will be synced across all your machines. For this to work transparently, you’ll want to make sure Dropbox is running at login.

1If you don’t have a Dropbox account, sign up using this link and we both get extra storage space for free.

Preventing TextMate from creating ._ files on network drives

If you use TextMate with files stored on a network drive, you may notice a bunch of hidden files start to creep up. These files begin with “._” and the name of the file. So if you’re working on info.php, there will be a ._info.php file in the same directory. These files are used for extended attributes. From the TextMate manual:

“TextMate makes use of extended attributes to store the carets position, bookmarks, what text is folded and is likely to make further use of extended attributes in the future.

For filesystems which do not natively support extended attributes (like network mounted disks), OS X instead stores the extra information in a file named ._«filename», where «filename» is the name of the original file.”

These files are small and hidden, but you may not want to litter the network server with these files, especially if you’re working with other people. To prevent these files from being created, run the following command in the terminal:

defaults write com.macromates.textmate OakDocumentDisableFSMetaData 1

Quit and restart TextMate to apply the changes. It won’t delete the files that have already been created, but it will prevent them from being created in the future. Files on your local drive will be unaffected.