Skip to content

Instantly share code, notes, and snippets.

@cbilson
Created September 21, 2017 13:45
Show Gist options
  • Save cbilson/b00820c3a69aa2a2d63bbfcb3aefa97e to your computer and use it in GitHub Desktop.
Save cbilson/b00820c3a69aa2a2d63bbfcb3aefa97e to your computer and use it in GitHub Desktop.
(defun cbilson/rust-mode-hook ()
(interactive)
(message "cbilson/rust-mode-hook...")
(cargo-minor-mode)
(local-set-key (kbd "C-c <tab>") #'rust-format-buffer)
(racer-mode +1)
(message "cbilson/rust-mode-hook: done"))
(use-package rust-mode
:init
(add-hook 'rust-mode-hook #'cbilson/rust-mode-hook)
:config
(use-package cargo)
(use-package racer
:init
(setq racer-cmd (concat (getenv "HOME") "/.cargo/bin/racer")
racer-rust-src-path (concat (getenv "HOME") "/src/rust/src"))
(add-hook 'racer-mode-hook #'eldoc-mode)
(add-hook 'racer-mode-hook #'company-mode))
(use-package flycheck-rust
:init
(add-hook 'flycheck-mode-hook #'flycheck-rust-setup)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment