🕷 zenspider.com

by ryan davis



sitemap
Looking for the Ruby Quickref?

toggle.el

Published 2012-06-19 @ 00:00

Tagged productivity, omnifocus

This is part of the Productivity Pr0n series.

toggle.el is available on my emacswiki page. It provides the ability to quickly open a corresponding file for the current buffer by using a bi-directional mapping of regular expression pairs. For example:

blah.rb     <-> test_blah.rb
lib/blah.rb <-> test/test_blah.rb

There are 7 different mapping styles in this version: zentest, rspec, rails, ruby, objc, c, and cpp. It is very easy to add more if you have a language or directory style that doesn’t match mine.

Then it is a simple matter of hooking it in. I use C-x C-t even tho it should probably be bound within C-c something because I use it so much.

1
(global-set-key (kbd "C-x C-t") 'toggle-buffer)

I especially use this when I’m coding TDD. I’ll have emacs fullscreened, split horizontally, with autotest on the right and code on the left. This lets me quickly flip between the test and the impl as I pump through TDD cycles.

emacs w/ autotest