From 1c0930fa65024e13d7381ab9a65fa0ee7f3eb2a2 Mon Sep 17 00:00:00 2001 From: finga Date: Wed, 15 Nov 2023 11:27:28 +0100 Subject: [PATCH] dev, rust: Extract Rust config into separate file Move configuration regarding Rust into its own file. --- .emacs.d/config/dev.el | 12 ------------ .emacs.d/config/rust.el | 13 +++++++++++++ .emacs.d/init.el | 2 +- .gitignore.d/emacs | 1 + 4 files changed, 15 insertions(+), 13 deletions(-) create mode 100644 .emacs.d/config/rust.el diff --git a/.emacs.d/config/dev.el b/.emacs.d/config/dev.el index 3617b46..aaa8f0a 100644 --- a/.emacs.d/config/dev.el +++ b/.emacs.d/config/dev.el @@ -22,18 +22,6 @@ :ensure t :bind ("M-s d" . deadgrep)) -;; rust -(use-package cargo :ensure t) -(use-package cargo-mode :ensure t) -(use-package rust-mode :ensure t) -(use-package flycheck-rust :ensure t) - -;; start cargo -(add-hook 'rust-mode-hook 'cargo-minor-mode) - -;; format code when saving -(setq rust-format-on-save t) - ;; yaml (use-package yaml-mode :ensure t) (use-package flycheck-yamllint :ensure t) diff --git a/.emacs.d/config/rust.el b/.emacs.d/config/rust.el new file mode 100644 index 0000000..bf43397 --- /dev/null +++ b/.emacs.d/config/rust.el @@ -0,0 +1,13 @@ +(use-package cargo + :ensure t + :config + ;; enable cargo keybindings + (add-hook 'rust-mode-hook 'cargo-minor-mode)) + +(use-package rust-mode + :ensure t + :config + ;; format code when saving + (setq rust-format-on-save t)) + +(use-package flycheck-rust :ensure t) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 9919a62..0a935e8 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -57,7 +57,7 @@ symbols, which are converted to strings, and suffixed with \".el\"." :group 'config-snippets :type '(repeat directory)) -(setq config-snippets '(base backups c calendar dev functions gpg matrix org pass wl)) +(setq config-snippets '(base backups c calendar dev functions gpg matrix org pass rust wl)) (message "Loading\nconfig-snippets: %s\nconfig-snippets-path: %s" config-snippets config-snippet-path) (dolist (snippet config-snippets) diff --git a/.gitignore.d/emacs b/.gitignore.d/emacs index 6c7a263..15f82b4 100644 --- a/.gitignore.d/emacs +++ b/.gitignore.d/emacs @@ -9,6 +9,7 @@ !/.emacs.d/config/matrix.el !/.emacs.d/config/org.el !/.emacs.d/config/pass.el +!/.emacs.d/config/rust.el !/.emacs.d/config/tramp.el !/.emacs.d/init.el !/.gitignore.d/emacs