Emacs equivalent of this Vim command to run my tests?

Posted by eightbitraptor on Super User See other posts from Super User or by eightbitraptor
Published on 2011-11-22T20:21:41Z Indexed on 2011/11/23 2:01 UTC
Read the original article Hit count: 147

Filed under:
|

I'm using Emacs at the moment and experimenting with it for my Rails development and there is one thing that I do quite regularly in Vim and I'd like to know if an equivalent exists in Emacs, or an alternative workflow to achieve the behavior that I need.

The command in Vim is

:map ;t :!rspec --no-color %<cr>

Essentially this maps a key combination to run a bash/shell command on the file represented by the current buffer (% expands to the filename at runtime, the <cr> is just a carriage return at the end to execute the command).

I map all sorts of random little commands as and when I need them and I really miss the immediacy of this approach.

How can I achieve something similar?

© Super User or respective owner

Related posts about vim

Related posts about emacs