feat(rust-setup): Add Rust setup
Adds a simple Rust setup with autocompletion via Racer and built-in Cargo command support.
This commit is contained in:
parent
0338fcc892
commit
6bef57e347
2 changed files with 16 additions and 0 deletions
2
init.el
2
init.el
|
@ -17,6 +17,7 @@
|
||||||
ace-jump-mode
|
ace-jump-mode
|
||||||
ag
|
ag
|
||||||
browse-kill-ring
|
browse-kill-ring
|
||||||
|
cargo
|
||||||
confluence
|
confluence
|
||||||
dash
|
dash
|
||||||
dockerfile-mode
|
dockerfile-mode
|
||||||
|
@ -38,6 +39,7 @@
|
||||||
password-store
|
password-store
|
||||||
pkgbuild-mode
|
pkgbuild-mode
|
||||||
puppet-mode
|
puppet-mode
|
||||||
|
racer
|
||||||
rainbow-delimiters
|
rainbow-delimiters
|
||||||
rainbow-mode
|
rainbow-mode
|
||||||
rust-mode
|
rust-mode
|
||||||
|
|
14
init/rust-setup.el
Normal file
14
init/rust-setup.el
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
(require 'rust-mode)
|
||||||
|
|
||||||
|
;; Enable cargo-related (C-c C-c C-...) commands.
|
||||||
|
(add-hook 'rust-mode-hook #'cargo-minor-mode)
|
||||||
|
|
||||||
|
;; Configure autocompletion for rust
|
||||||
|
(add-hook 'rust-mode-hook #'racer-mode)
|
||||||
|
(add-hook 'racer-mode-hook #'company-mode)
|
||||||
|
(add-hook 'racer-mode-hook #'eldoc-mode)
|
||||||
|
(define-key rust-mode-map (kbd "TAB") #'company-indent-or-complete-common)
|
||||||
|
(setq company-tooltip-align-annotations t)
|
||||||
|
|
||||||
|
;; Ensure long compiler errors don't flow out of the screen (very annoying!)
|
||||||
|
(add-hook 'cargo-process-mode-hook #'visual-line-mode)
|
Loading…
Reference in a new issue