Sign up ×
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.

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

1 Answer 1

up vote 2 down vote accepted

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

def emacs(*args)
  names = { |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.