Enable hs-mode (HideShow) within ruby-mode

This commit is contained in:
2012-04-13 00:36:53 +01:00
parent 3bba84651b
commit 5763035187

View File

@@ -30,9 +30,12 @@
(setq c-tab-always-indent nil)
(setq ruby-use-encoding-map nil)
(setq ruby-electric-expand-delimiters-list (quote (124)))
(hs-minor-mode 1)
(setq whitespace-action (quote (auto-cleanup)))
(define-key ruby-mode-map
(kbd "RET") 'reindent-then-newline-and-indent)
(define-key ruby-mode-map
(kbd "C-c C-j") 'hs-toggle-hiding)
(define-key ruby-mode-map
(kbd "s-r") 'ruby-compilation-this-buffer)
(define-key ruby-mode-map
@@ -46,6 +49,12 @@
(define-key ruby-mode-map
(kbd "C-c C-b") 'eproject-ibuffer)))
;; Set up hs-mode (HideShow) for Ruby
(add-to-list 'hs-special-modes-alist
'(ruby-mode
"\\(def \\|class\\|module\\|do\\)" "end" "#"
(lambda (arg) (ruby-end-of-block)) nil))
;; Workaround for missing method in ruby-mode.el
;; See: https://gist.github.com/1213051
(defun ruby-insert-end ()