This post originated from an RSS feed registered with Ruby Buzz
by Ryan Davis.
Original Post: New Category: Emacs
Feed Title: Polishing Ruby
Feed URL: http://blog.zenspider.com/index.rdf
Feed Description: Musings on Ruby and the Ruby Community...
I'm an emacs freak. I've been an emacs freak for... forever... no, since 1991. Anyhow, I've been continually evolving my emacs setup (under revision control) since 1996 and am always looking for things to increase my productivity without being too heavyweight. I'll share what I can here. I'll start with one of my new favorites:
This adds an extra keybinding to interactive search (C-s) that runs occur on the current search string/regexp, immediately showing all hits in the entire buffer. I use it all the time now. Example:
C-M-s ^ *\(class\|module\|def\) C-o
quickly gives me an index of the entire file:
24 matches for "^ *\(class\|module\|def\)" in buffer: autotest.rb
57:class Autotest
61: def self.run
67: def initialize
77: def run
... and so on ...
and C-s somemethodiamrefactoring C-o
immediately shows me all the call points of the method I'm planning to refactor.