Files
emacs.d/site-start.d/401-rust.el
2020-06-24 01:35:16 +02:00

58 lines
1.4 KiB
EmacsLisp

;;; 401-rust.el --- handle rust code
;;; Commentary:
;; using rust-mode with rust-analyzer via lsp
;;; Code:
;; load rustic -> IDE like for rust
;; it superseeds rust-mode
(use-package rustic
:ensure t
:config
;; recommended: use spaces instead of tabs
(add-hook 'rust-mode-hook
(lambda () (setq indent-tabs-mode nil)))
(add-hook 'rustic-mode-hook
(lambda () (setq indent-tabs-mode nil)))
;; enable code folding und line numbering rust buffers
(add-hook 'prog-mode-hook
;;'lsp-origami-mode
'hs-minor-mode
'linum-relative-mode)
;;(remove-hook 'rustic-mode-hook 'flycheck-mode)
;; use the lsp UI package
;; https://emacs-lsp.github.io/lsp-mode
(use-package lsp-ivy)
(use-package lsp-ui)
;; use the yasnippet
(use-package yasnippet
;; YASnippet is a template system for Emacs.
;; It allows you to type an abbreviation and automatically expand it into function templates
;; use YASnippet as a non-global minor mode
:config
(yas-reload-all))
;; company-capf.el from load-path
(use-package linum-relative
:config
(setq linum-relative-backend 'display-line-numbers-mode))
:custom
;;(linum-on)
;;(linum-relative-toggle)
;;(hs-minor-mode t)
;;(lsp-origami-try-enable)
;;(linum-relative-mode 1))
(rustic-lsp-server 'rust-analyzer)
(rustic-lsp-format t))
(provide '401-rust)
;; Local Variables:
;; no-byte-compile: t
;; End
;;; 401-rust.el ends here