comparison .elisp/settings/99.rust.el @ 501:514374a2a5bc

emacs: migrate rust config to use rls and lsp
author Augie Fackler <raf@durin42.com>
date Sat, 03 Oct 2020 11:30:21 -0400
parents f08193904d93
children 7d298a83fceb
comparison
equal deleted inserted replaced
500:826e5656d9ff 501:514374a2a5bc
1 (use-package flycheck
2 :hook (prog-mode . flycheck-mode))
3
4 (use-package company
5 :hook (prog-mode . company-mode)
6 :config (setq company-tooltip-align-annotations t)
7 (setq company-minimum-prefix-length 1))
8
9 (use-package lsp-mode
10 :commands lsp
11 :config (require 'lsp-clients))
12
13 (use-package lsp-ui)
14
15 (use-package toml-mode)
16
1 (use-package rust-mode 17 (use-package rust-mode
2 :config (add-hook 'rust-mode-hook 18 :hook (rust-mode . lsp)
19 :config (add-hook 'rust-mode-hook
3 (lambda () 20 (lambda ()
4 (local-set-key (kbd "C-c <tab>") #'rust-format-buffer)))) 21 (local-set-key (kbd "C-c <tab>") #'rust-format-buffer))))
5 (setq rust-format-on-save t)
6 22
23 ;; Add keybindings for interacting with Cargo
7 (use-package cargo 24 (use-package cargo
8 :config (add-hook 'rust-mode-hook 'cargo-minor-mode)) 25 :hook (rust-mode . cargo-minor-mode))
9
10 (use-package company
11 :init
12 (use-package racer
13 :init
14 (add-hook 'rust-mode-hook #'racer-mode)
15 (add-hook 'racer-mode-hook #'eldoc-mode)
16 (add-hook 'racer-mode-hook #'company-mode)
17 (setq company-tooltip-align-annotations t)
18 ))
19 26
20 (use-package flycheck-rust 27 (use-package flycheck-rust
21 :init 28 :config (add-hook 'flycheck-mode-hook #'flycheck-rust-setup))
22 (add-hook 'flycheck-mode-hook #'flycheck-rust-setup)
23 (add-hook 'rust-mode-hook 'flycheck-mode)
24 )