The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
New Category: Emacs

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Ryan Davis

Posts: 651
Nickname: zenspider
Registered: Oct, 2004

Ryan Davis is a ruby nerd.
New Category: Emacs Posted: Feb 26, 2007 7:30 PM
Reply to this message Reply

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...
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Ryan Davis
Latest Posts From Polishing Ruby

Advertisement

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:

(define-key isearch-mode-map (kbd "C-o")
  (lambda ()
    (interactive)
    (let ((case-fold-search isearch-case-fold-search))
      (occur (if isearch-regexp isearch-string
               (regexp-quote isearch-string))))))

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.

Read: New Category: Emacs

Topic: Installing Starter Toolkit for DB2 on Rails on Windows Vista Previous Topic   Next Topic Topic: How Rails helped me win three books

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use