Browse Source

emacs: use mmm-mode, add rust-doc group

master
Alison Watson 1 year ago
parent
commit
9fcf97a49f
1 changed files with 22 additions and 0 deletions
  1. +22
    -0
      emacs/init.el

+ 22
- 0
emacs/init.el View File

@@ -95,6 +95,26 @@
:foreground "#92ebf0"))

;; major modes
(use-package mmm-mode
:ensure t
:init
(setq mmm-submode-decoration-level 0)
:config
(require 'mmm-auto)
(mmm-add-group 'rust-doc
'((rust-doc-line
:submode markdown-mode
:face mmm-comment-submode-face
:front "///\s+"
:back "\n")
(rust-doc-block
:submode markdown-mode
:face mmm-comment-submode-face
:front "/\\*\\*"
:back "\\*\\*/")))
(mmm-add-mode-ext-class 'ruby-mode nil 'here-doc)
(mmm-add-mode-ext-class 'rust-mode nil 'rust-doc))

(use-package cc-mode
:mode (("\\.zsc\\'" . c-mode)
("\\.zc\\'" . c-mode))
@@ -123,12 +143,14 @@
:ensure t)

(use-package ruby-mode
:hook ((ruby-mode . mmm-mode))
:init
(defvaralias 'ruby-indent-level 'tab-width)
(setq ruby-insert-encoding-magic-comment nil))

(use-package rust-mode
:ensure t
:hook ((rust-mode . mmm-mode))
:init
(defvaralias 'rust-indent-offset 'tab-width))



Loading…
Cancel
Save