Make Rust config the best ever
This commit is contained in:
parent
6214f60f72
commit
33e0010f7f
5 changed files with 80 additions and 48 deletions
|
@ -20,6 +20,30 @@
|
|||
(global-set-key (kbd "S-C-j") 'shrink-window)
|
||||
(global-set-key (kbd "S-C-k") 'enlarge-window)
|
||||
|
||||
(use-package which-key
|
||||
:diminish
|
||||
:config
|
||||
(which-key-mode)
|
||||
(which-key-setup-side-window-bottom)
|
||||
(setq which-key-idle-delay 0.1))
|
||||
|
||||
(use-package diminish
|
||||
:defer 5
|
||||
:config
|
||||
(diminish 'org-indent-mode))
|
||||
|
||||
;; Note that ‘uniquify’ is builtin.
|
||||
(require 'uniquify)
|
||||
(setq uniquify-separator "/" ;; The separator in buffer names.
|
||||
uniquify-buffer-name-style 'forward) ;; names/in/this/style
|
||||
|
||||
(use-package rg
|
||||
:config
|
||||
(global-set-key (kbd "M-s g") 'rg)
|
||||
(global-set-key (kbd "M-s d") 'rg-dwim))
|
||||
|
||||
(use-package helm-rg)
|
||||
|
||||
;;;; Company configuration.
|
||||
(use-package company
|
||||
:ensure t
|
||||
|
@ -48,7 +72,7 @@
|
|||
(evil-mode)
|
||||
(setq evil-want-C-u-scroll t)
|
||||
(eval-after-load "evil-maps"
|
||||
;; Unset Evil's "M-." keymap so that TAGS definitions can be followed.
|
||||
;; Unset Evil's "M-." keymap to enable symbol definition following.
|
||||
(define-key evil-normal-state-map "\M-." nil)))
|
||||
|
||||
(use-package undo-tree
|
||||
|
|
|
@ -1,14 +1,4 @@
|
|||
;;;; Python configuration.
|
||||
(use-package jupyter
|
||||
:ensure t)
|
||||
(use-package ein
|
||||
:ensure t)
|
||||
(use-package py-autopep8
|
||||
:ensure t)
|
||||
(use-package yasnippet
|
||||
:ensure t)
|
||||
(use-package jedi
|
||||
:ensure t)
|
||||
(use-package elpy
|
||||
:ensure t
|
||||
:init
|
||||
|
@ -21,6 +11,16 @@
|
|||
python-indent-offset 4
|
||||
python-shell-interpreter-args "console --simple-prompt"
|
||||
python-shell-prompt-detect-failure-warning nil)
|
||||
(use-package jupyter
|
||||
:ensure t)
|
||||
(use-package ein
|
||||
:ensure t)
|
||||
(use-package py-autopep8
|
||||
:ensure t)
|
||||
(use-package yasnippet
|
||||
:ensure t)
|
||||
(use-package jedi
|
||||
:ensure t)
|
||||
;; Use IPython for REPL
|
||||
(add-to-list 'python-shell-completion-native-disabled-interpreters
|
||||
"jupyter")
|
||||
|
|
|
@ -1,43 +1,36 @@
|
|||
;;;; Rust mode configuration.
|
||||
;; Add rust load hooks.
|
||||
(use-package rustic
|
||||
:config
|
||||
(setq rustic-flycheck-clippy-params "--message-format=json"))
|
||||
|
||||
(use-package flycheck
|
||||
:hook (prog-mode . flycheck-mode))
|
||||
:hook (prog-mode . flycheck-mode))
|
||||
|
||||
(use-package company
|
||||
:hook (prog-mode . company-mode)
|
||||
:config (setq company-tooltip-align-annotations t)
|
||||
(setq company-minimum-prefix-length 1))
|
||||
:hook (prog-mode . company-mode)
|
||||
:config (setq company-tooltip-align-annotations t)
|
||||
(setq company-minimum-prefix-length 1))
|
||||
|
||||
(use-package lsp-mode
|
||||
:commands lsp
|
||||
:config (require 'lsp-clients))
|
||||
:commands lsp
|
||||
:config (require 'lsp-clients))
|
||||
|
||||
(use-package lsp-ui
|
||||
:commands lsp-ui-mode
|
||||
:bind (:map lsp-ui-mode-map
|
||||
("M-." . lsp-ui-peek-find-definitions)
|
||||
("M-," . lsp-ui-peek-jump-backward)
|
||||
("M-?" . lsp-ui-peek-find-references)
|
||||
("C-c u" . lsp-ui-imenu)
|
||||
("C-c C-a" . lsp-ui-sideline-apply-code-actions))
|
||||
:config (setq lsp-ui-peek-enable t))
|
||||
:commands lsp-ui-mode
|
||||
:config (setq lsp-ui-peek-enable t)
|
||||
:bind (:map lsp-ui-mode-map
|
||||
("M-." . lsp-ui-peek-find-definitions)
|
||||
("M-," . lsp-ui-peek-jump-backward)
|
||||
("M-?" . lsp-ui-peek-find-references)
|
||||
("C-c u" . lsp-ui-imenu)
|
||||
("C-c C-a" . lsp-ui-sideline-apply-code-actions)))
|
||||
|
||||
(use-package rust-mode
|
||||
:config
|
||||
(setq rust-format-on-save t)
|
||||
:hook (rust-mode . lsp))
|
||||
|
||||
(use-package lsp-rust
|
||||
:after lsp-mode
|
||||
:config
|
||||
(setq lsp-rust-server 'rust-analyzer))
|
||||
|
||||
|
||||
;; Add keybindings for interacting with Cargo
|
||||
(use-package cargo
|
||||
:hook (rust-mode . cargo-minor-mode))
|
||||
(use-package helm-lsp
|
||||
:config
|
||||
(define-key lsp-mode-map [remap xref-find-apropos] #'helm-lsp-workspace-symbol))
|
||||
|
||||
(use-package flycheck-rust
|
||||
:config (add-hook 'flycheck-mode-hook #'flycheck-rust-setup))
|
||||
:config (add-hook 'flycheck-mode-hook #'flycheck-rust-setup))
|
||||
|
||||
(provide 'jenga-rust)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue