Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 39 lines (31 sloc) 1.277 kb
5fcb34d @technomancy initial commit
authored
1 ;;; starter-kit-ruby.el --- Some helpful Ruby code
2 ;;
3 ;; Part of the Emacs Starter Kit
4
5
6 ;; TODO: move this stuff to autoloads?
7 (require 'ruby-mode)
8 (require 'ruby-compilation)
9
10 (defun rr (&optional arg)
11 "Run a Ruby interactive shell session in a buffer."
12 (interactive "P")
13 (let ((impl (if (not arg)
14 "mri"
15 (completing-read "Ruby Implementation: "
16 '("ruby" "jruby" "rubinius" "yarv")))))
17 (run-ruby (cdr (assoc impl '(("mri" . "irb")
18 ("jruby" . "jruby -S irb")
19 ("rubinius" . "rbx")
20 ("yarv" . "irb1.9")))))
21 (with-current-buffer "*ruby*"
22 (rename-buffer (format "*%s*" impl) t))))
23
24 (define-key ruby-mode-map (kbd "C-M-h") 'backward-kill-word)
25 (define-key ruby-mode-map (kbd "RET") 'ruby-reindent-then-newline-and-indent)
26 (define-key ruby-mode-map (kbd "C-c l") (lambda ()
27 (interactive) (insert "lambda")))
28
29 (global-set-key (kbd "C-h r") 'ri)
30
31 ;; We never want to edit Rubinius bytecode
32 (add-to-list 'completion-ignored-extensions ".rbc")
33
34 ;; TODO: set up ri
35 ;; TODO: electric
36 ;; TODO: flymake
37
38 (provide 'starter-kit-ruby)
39 ;; starter-kit-ruby.el ends here
Something went wrong with that request. Please try again.