diff options
Diffstat (limited to 'init/rust-setup.el')
-rw-r--r-- | init/rust-setup.el | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/init/rust-setup.el b/init/rust-setup.el new file mode 100644 index 000000000000..a4cf3c5a5116 --- /dev/null +++ b/init/rust-setup.el @@ -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) |