Better default behaviour in enh-ruby-mode

This commit is contained in:
Tristan Hume 2015-05-26 21:29:55 -04:00 committed by syl20bnr
parent 10308ffd2a
commit a883a61f3a

View file

@ -37,7 +37,16 @@
"Initialize Ruby Mode"
(use-package enh-ruby-mode
:mode (("\\(Rake\\|Thor\\|Guard\\|Gem\\|Cap\\|Vagrant\\|Berks\\|Pod\\|Puppet\\)file\\'" . enh-ruby-mode)
("\\.\\(rb\\|rabl\\|ru\\|builder\\|rake\\|thor\\|gemspec\\|jbuilder\\)\\'" . enh-ruby-mode))))
("\\.\\(rb\\|rabl\\|ru\\|builder\\|rake\\|thor\\|gemspec\\|jbuilder\\)\\'" . enh-ruby-mode))
:config
(progn
(setq enh-ruby-deep-indent-paren nil
enh-ruby-hanging-paren-deep-indent-level 2)
(sp-with-modes '(ruby-mode enh-ruby-mode)
(sp-local-pair "{" "}"
:pre-handlers '(sp-ruby-pre-handler)
:post-handlers '(sp-ruby-post-handler (spacemacs/smartparens-pair-newline-and-indent "RET"))
:suffix "")))))
(defun ruby/post-init-flycheck ()
(add-hook 'enh-ruby-mode-hook 'flycheck-mode))
@ -174,4 +183,5 @@
(when (configuration-layer/layer-usedp 'auto-completion)
(defun ruby/post-init-company ()
(spacemacs|add-company-hook enh-ruby-mode)))
(spacemacs|add-company-hook enh-ruby-mode)
(push 'enh-ruby-mode company-dabbrev-code-modes)))