Fix Rust configuration
This commit is contained in:
parent
24158ceedf
commit
2f3891b6d2
2
init.el
2
init.el
@ -107,7 +107,7 @@
|
|||||||
programming
|
programming
|
||||||
terminal
|
terminal
|
||||||
version-control
|
version-control
|
||||||
workflow
|
;; workflow
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,14 +23,18 @@
|
|||||||
function-args
|
function-args
|
||||||
flycheck
|
flycheck
|
||||||
flycheck-pos-tip
|
flycheck-pos-tip
|
||||||
|
flycheck-rust
|
||||||
highlight-numbers
|
highlight-numbers
|
||||||
highlight-symbol
|
highlight-symbol
|
||||||
racer
|
|
||||||
rust-mode
|
rust-mode
|
||||||
sr-speedbar
|
sr-speedbar
|
||||||
stickyfunc-enhance
|
stickyfunc-enhance
|
||||||
swiper
|
swiper
|
||||||
yasnippet)
|
toml-mode
|
||||||
|
yasnippet
|
||||||
|
|
||||||
|
s
|
||||||
|
f)
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -99,8 +103,12 @@
|
|||||||
:init
|
:init
|
||||||
(add-hook 'after-init-hook #'global-flycheck-mode)
|
(add-hook 'after-init-hook #'global-flycheck-mode)
|
||||||
:config
|
:config
|
||||||
(require 'flycheck-pos-tip)
|
(use-package flycheck-pos-tip
|
||||||
|
:init
|
||||||
(flycheck-pos-tip-mode))
|
(flycheck-pos-tip-mode))
|
||||||
|
(use-package flycheck-pos-tip
|
||||||
|
:init
|
||||||
|
(add-hook 'flycheck-mode-hook #'flycheck-rust-setup)))
|
||||||
|
|
||||||
;; --------------------------------------------------------------------------
|
;; --------------------------------------------------------------------------
|
||||||
;; Highlights.
|
;; Highlights.
|
||||||
@ -134,18 +142,26 @@
|
|||||||
;; and the Rust libstd sources must be installed.
|
;; and the Rust libstd sources must be installed.
|
||||||
;; $ rustup component add rust-src
|
;; $ rustup component add rust-src
|
||||||
;; $ cargo install racer
|
;; $ cargo install racer
|
||||||
|
(add-to-list 'load-path "~/.emacs.d/racer")
|
||||||
(use-package racer
|
(use-package racer
|
||||||
:init
|
:init
|
||||||
(add-hook 'rust-mode-hook #'racer-mode)
|
(add-hook 'rust-mode-hook #'racer-mode)
|
||||||
(add-hook 'racer-mode-hook #'eldoc-mode)
|
(add-hook 'racer-mode-hook #'eldoc-mode)
|
||||||
:config
|
:config
|
||||||
(setq-default
|
;; For racer to work, it needs to know where to find the standard library
|
||||||
racer-rust-src-path
|
;; sources. The easiest way to do it without having a machine dependent
|
||||||
"~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/")
|
;; setup is to set the environment variable RUST_SRC_PATH. If that's
|
||||||
|
;; undesirable or not possible, set the variable below instead.
|
||||||
(require 'rust-mode)
|
;; (setq-default
|
||||||
|
;; racer-rust-src-path
|
||||||
|
;; "~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/")
|
||||||
|
(setq-default racer-use-company-backend t)
|
||||||
(define-key rust-mode-map (kbd "TAB") #'company-indent-or-complete-common)
|
(define-key rust-mode-map (kbd "TAB") #'company-indent-or-complete-common)
|
||||||
(setq company-tooltip-align-annotations t))
|
(setq-default company-tooltip-align-annotations t))
|
||||||
|
|
||||||
|
(use-package toml-mode
|
||||||
|
:defer t
|
||||||
|
:mode "\\.lock\\'")
|
||||||
|
|
||||||
;; --------------------------------------------------------------------------
|
;; --------------------------------------------------------------------------
|
||||||
;; Speedbar.
|
;; Speedbar.
|
||||||
|
Reference in New Issue
Block a user