15enero2024

This commit is contained in:
Raymundo Vásquez Ruiz
2024-01-15 16:15:38 +01:00
parent a35dfaac7c
commit 2e1b0e3ccf
2 changed files with 68 additions and 7 deletions

View File

@@ -29,7 +29,7 @@ There are two things you can do about this warning:
'(global-display-line-numbers-mode t) '(global-display-line-numbers-mode t)
'(inhibit-startup-screen t) '(inhibit-startup-screen t)
'(package-selected-packages '(package-selected-packages
'(flycheck-gometalinter go-mode doom-themes lsp-mode hydra gitlab-ci-mode gitlab-ci-mode-flycheck web-mode impatient-mode exec-path-from-shell rust-playground all-the-icons neotree base16-theme afternoon-theme ample-theme nord-theme company-racer racer markdown-mode+ dumb-jump magit company flycheck-rust flycheck json-mode flymake-json tss tide material-theme zenburn-theme ac-js2 auto-complete projectile helm js2-mode cargo rust-mode iedit gitlab-ci-mode gitlab-ci-mode-flycheck dap-mode typescript-mode tree-sitter tree-sitter-langs)) '(rustic toml-mode lsp-ui flycheck-gometalinter go-mode doom-themes lsp-mode hydra gitlab-ci-mode gitlab-ci-mode-flycheck web-mode impatient-mode exec-path-from-shell rust-playground all-the-icons neotree base16-theme afternoon-theme ample-theme nord-theme company-racer racer markdown-mode+ dumb-jump magit company flycheck-rust flycheck json-mode flymake-json tss tide material-theme zenburn-theme ac-js2 auto-complete projectile helm js2-mode cargo rust-mode iedit gitlab-ci-mode gitlab-ci-mode-flycheck dap-mode typescript-mode tree-sitter tree-sitter-langs))
'(tool-bar-mode nil)) '(tool-bar-mode nil))
(custom-set-faces (custom-set-faces
;; custom-set-faces was added by Custom. ;; custom-set-faces was added by Custom.
@@ -38,6 +38,8 @@ There are two things you can do about this warning:
;; If there is more than one, they won't work right. ;; If there is more than one, they won't work right.
'(default ((t (:family "Menlo" :foundry "CTDB" :slant normal :weight normal :height 160 :width normal))))) '(default ((t (:family "Menlo" :foundry "CTDB" :slant normal :weight normal :height 160 :width normal)))))
(require 'use-package)
(add-to-list 'load-path "~/.emacs.d/lib") (add-to-list 'load-path "~/.emacs.d/lib")
(require 'init-editor) (require 'init-editor)
(require 'init-web) (require 'init-web)

View File

@@ -2,13 +2,72 @@
(require 'rust-mode) (require 'rust-mode)
(add-to-list 'auto-mode-alist '("\\.rs\\'" . rust-mode)) (add-to-list 'auto-mode-alist '("\\.rs\\'" . rust-mode))
(setq rust-format-on-save t) (setq rust-format-on-save t)
(add-hook 'rust-mode-hook 'cargo-minor-mode) (add-hook 'rust-mode-hook 'cargo-minor-mode)
(with-eval-after-load 'rust-mode
(add-hook 'flycheck-mode-hook #'flycheck-rust-setup)) ;; (with-eval-after-load 'rust-mode
(add-hook 'rust-mode-hook #'racer-mode) ;; (add-hook 'flycheck-mode-hook #'flycheck-rust-setup))
(add-hook 'racer-mode-hook #'eldoc-mode) ;; (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) ;; (add-hook 'racer-mode-hook #'company-mode)
;; (define-key rust-mode-map (kbd "TAB") #'company-indent-or-complete-common)
;; -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
;; rustic = basic rust-mode + additions
(use-package rustic
:ensure
:bind (:map rustic-mode-map
("M-j" . lsp-ui-imenu)
("M-?" . lsp-find-references)
("C-c C-c l" . flycheck-list-errors)
("C-c C-c a" . lsp-execute-code-action)
("C-c C-c r" . lsp-rename)
("C-c C-c q" . lsp-workspace-restart)
("C-c C-c Q" . lsp-workspace-shutdown)
("C-c C-c s" . lsp-rust-analyzer-status)
("C-c C-c e" . lsp-rust-analyzer-expand-macro)
("C-c C-c d" . dap-hydra)
("C-c C-c h" . lsp-ui-doc-glance))
:config
;; uncomment for less flashiness
;; (setq lsp-eldoc-hook nil)
;; (setq lsp-enable-symbol-highlighting nil)
;; (setq lsp-signature-auto-activate nil)
;; comment to disable rustfmt on save
(add-hook 'rustic-mode-hook 'rk/rustic-mode-hook))
(use-package lsp-mode
:ensure
:commands lsp
:custom
;; what to use when checking on-save. "check" is default, I prefer clippy
(lsp-rust-analyzer-cargo-watch-command "clippy")
(lsp-eldoc-render-all t)
(lsp-idle-delay 0.6)
;; enable / disable the hints as you prefer:
(lsp-rust-analyzer-server-display-inlay-hints t)
(lsp-rust-analyzer-display-lifetime-elision-hints-enable "skip_trivial")
(lsp-rust-analyzer-display-chaining-hints t)
(lsp-rust-analyzer-display-lifetime-elision-hints-use-parameter-names nil)
(lsp-rust-analyzer-display-closure-return-type-hints t)
(lsp-rust-analyzer-display-parameter-hints nil)
(lsp-rust-analyzer-display-reborrow-hints nil)
:config
(add-hook 'lsp-mode-hook 'lsp-ui-mode))
(use-package lsp-ui
:ensure
:commands lsp-ui-mode
:custom
(lsp-ui-peek-always-show t)
(lsp-ui-sideline-show-hover t)
(lsp-ui-doc-enable nil))
(use-package toml-mode :ensure)
(use-package flycheck :ensure)
;; Rust playground https://github.com/grafov/rust-playground ;; Rust playground https://github.com/grafov/rust-playground
;; M-x rust-playground -> Type -> Ctrl-RET -> See results -> M-x rust-playground-rm ;; M-x rust-playground -> Type -> Ctrl-RET -> See results -> M-x rust-playground-rm