Rust
authorJoerg Jaspert <joerg@debian.org>
Mon, 11 Dec 2017 17:28:38 +0000 (18:28 +0100)
committerJoerg Jaspert <joerg@debian.org>
Mon, 11 Dec 2017 17:29:03 +0000 (18:29 +0100)
.emacs.d/config/emacs.org

index d7b3f04..00cb1a9 100644 (file)
@@ -3834,6 +3834,7 @@ CLOSED: [2017-08-26 Sat 15:09]
                               (mode . haml-mode)
                               (mode . nxml-mode)
                               (mode . go-mode)
+                              (mode . rust-mode)
                               (mode . css-mode)))
                      ("other" (or
                                (mode . magit-log-edit-mode)
@@ -3857,6 +3858,7 @@ CLOSED: [2017-08-26 Sat 15:09]
                               (mode . haml-mode)
                               (mode . nxml-mode)
                               (mode . go-mode)
+                              (mode . rust-mode)
                               (mode . css-mode)))
                      ;; -------------------------------------------------
                      ;; configuration/data files
@@ -5896,14 +5898,16 @@ CLOSED: [2017-08-26 Sat 15:21]
    (progn
      (define-key rust-mode-map (kbd "TAB") #'company-indent-or-complete-common)
      (setq company-tooltip-align-annotations t)
+     (setq rust-format-on-save t)
+     (add-hook 'rust-mode-hook
+               (lambda ()
+                 (local-set-key (kbd "C-c <tab>") #'rust-format-buffer)))
+
      (use-package cargo
        :ensure t
        :config
        (progn
-         (add-hook 'rust-mode-hook 'cargo-minor-mode)))
-     (add-hook 'rust-mode-hook
-               (lambda ()
-               (local-set-key (kbd "C-c <tab>") #'rust-format-buffer)))))
+         (add-hook 'rust-mode-hook 'cargo-minor-mode)))))
 
  (use-package racer
    :ensure t