Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am starting to learn the basics of rush (ruby shell), and I know it is possible to invoke methods such as home['foobar.c'].vi.

However, say I wanted to edit it with GNU Emacs, how do I add a new method that does that for me, so I can only invoke home['foobar.c'].emacs?

P.S. There is a configuration file env.rb, in which you can put Ruby code.

share|improve this question
up vote 2 down vote accepted

Apparently from http://rush.heroku.com/handbook/environment, I'm guessing you'd put this into ~/.rush/commands.rb -- modifying the source entry for the vi proc here

def emacs(*args)
  names = entries.map { |f| f.full_path }.join(' ')
  system "emacs #{names} #{args.join(' ')}"
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.