add some tweaks to the rust experience

This commit is contained in:
Chris Cochrun 2023-04-04 09:53:10 -05:00
parent d1b7c590e5
commit 3679fe904b
2 changed files with 60 additions and 10 deletions

View file

@ -851,7 +851,7 @@ Part of this config includes some special capture templates for my work as a you
:keymaps 'override
"c" 'org-capture
"rr" 'org-refile
"e" 'org-export-dispatch
"E" 'org-export-dispatch
"oa" 'org-agenda-list
"gt" 'org-babel-tangle
"il" 'org-insert-link
@ -2399,6 +2399,10 @@ Ace link provides an avy like search for links. Upon using the keybindings prese
(display-buffer-in-side-window)
(side . right)
(window-width . 0.4))
("*rustic-compilation*"
(display-buffer-in-side-window)
(side . right)
(window-width . 0.4))
("*org-roam*"
(display-buffer-in-side-window)
(side . right)
@ -2517,7 +2521,9 @@ Before getting into languages, often times compilation of things use ansi-colors
#+BEGIN_SRC emacs-lisp
(defvar read-symbol-positions-list nil)
(add-to-list 'comint-output-filter-functions 'ansi-color-process-output)
(add-hook 'comint-mode-hook 'ansi-color-for-comint-mode-on)
(add-hook 'compilation-filter-hook 'ansi-color-for-comint-mode-on)
#+END_SRC
Let's also set =hl-line-mode= to be on for comint and prog modes
@ -2587,7 +2593,16 @@ I'd like to start learning and using rust if I can.
:config
;; comment to disable rustfmt on save
(setq rustic-format-on-save t
rustic-lsp-client 'eglot))
rustic-lsp-client 'eglot)
:general
(general-def 'normal rustic-mode-map
"!" 'rustic-run-shell-command
"gC" 'rustic-cargo-check
"gA" 'rustic-cargo-add)
(chris/leader-keys
:states 'normal
:keymaps 'override
"gc" 'rustic-compile))
#+end_src
*** Web
@ -2685,7 +2700,11 @@ Let's give eglot a try.
(c++-mode . eglot-ensure)
(c++-ts-mode . eglot-ensure)
(rust-mode . eglot-ensure)
(rust-ts-mode . eglot-ensure))
(rustic-mode . eglot-ensure)
(rust-ts-mode . eglot-ensure)
:general
(general-def 'normal eglot-mode-map
))
#+end_src
#+begin_src emacs-lisp
@ -2755,7 +2774,13 @@ It's probably smart to have markdown.
:mode ("\\.md\\'" . markdown-mode)
:config
(setq markdown-fontify-code-blocks-natively t)
(add-hook 'markdown-mode-hook 'chris/org-mode-setup))
(add-hook 'markdown-mode-hook 'chris/org-mode-setup)
:general
(general-def 'normal markdown-mode-map
"C-j" 'markdown-next-visible-heading
"M-j" 'markdown-move-down
"C-k" 'markdown-previous-visible-heading
"M-k" 'markdown-move-up))
#+end_src
*** QML
@ -3987,7 +4012,7 @@ Let's also use an automatic garbage collector while idle to make better input.
:init
(gcmh-mode)
:config
(setq gcmh-idle-delay 5
(setq gcmh-idle-delay 2
gcmh-high-cons-threshold (* 128 1024 1024) ; 128mb
gcmh-verbose nil))
#+end_src

35
init.el
View file

@ -578,7 +578,7 @@ much faster. The hope is to also make this a faster version of imenu."
:keymaps 'override
"c" 'org-capture
"rr" 'org-refile
"e" 'org-export-dispatch
"E" 'org-export-dispatch
"oa" 'org-agenda-list
"gt" 'org-babel-tangle
"il" 'org-insert-link
@ -1766,6 +1766,10 @@ targets."
(display-buffer-in-side-window)
(side . right)
(window-width . 0.4))
("*rustic-compilation*"
(display-buffer-in-side-window)
(side . right)
(window-width . 0.4))
("*org-roam*"
(display-buffer-in-side-window)
(side . right)
@ -1867,7 +1871,9 @@ targets."
:defer 1)
(defvar read-symbol-positions-list nil)
(add-to-list 'comint-output-filter-functions 'ansi-color-process-output)
(add-hook 'comint-mode-hook 'ansi-color-for-comint-mode-on)
(add-hook 'compilation-filter-hook 'ansi-color-for-comint-mode-on)
(add-hook 'comint-mode-hook 'hl-line-mode)
(add-hook 'prog-mode-hook 'hl-line-mode)
@ -1912,7 +1918,16 @@ targets."
:config
;; comment to disable rustfmt on save
(setq rustic-format-on-save t
rustic-lsp-client 'eglot))
rustic-lsp-client 'eglot)
:general
(general-def 'normal rustic-mode-map
"!" 'rustic-run-shell-command
"gC" 'rustic-cargo-check
"gA" 'rustic-cargo-add)
(chris/leader-keys
:states 'normal
:keymaps 'override
"gc" 'rustic-compile))
(use-package web-mode
:mode "\\.html\\'"
@ -1950,7 +1965,11 @@ targets."
(c++-mode . eglot-ensure)
(c++-ts-mode . eglot-ensure)
(rust-mode . eglot-ensure)
(rust-ts-mode . eglot-ensure))
(rustic-mode . eglot-ensure)
(rust-ts-mode . eglot-ensure)
:general
(general-def 'normal eglot-mode-map
))
(use-package consult-eglot
:general
@ -1981,7 +2000,13 @@ targets."
:mode ("\\.md\\'" . markdown-mode)
:config
(setq markdown-fontify-code-blocks-natively t)
(add-hook 'markdown-mode-hook 'chris/org-mode-setup))
(add-hook 'markdown-mode-hook 'chris/org-mode-setup)
:general
(general-def 'normal markdown-mode-map
"C-j" 'markdown-next-visible-heading
"M-j" 'markdown-move-down
"C-k" 'markdown-previous-visible-heading
"M-k" 'markdown-move-up))
(use-package qml-mode
:mode ("\\.qml\\'" . qml-mode))
@ -2944,7 +2969,7 @@ interfere with the default `bongo-playlist-buffer'."
:init
(gcmh-mode)
:config
(setq gcmh-idle-delay 5
(setq gcmh-idle-delay 2
gcmh-high-cons-threshold (* 128 1024 1024) ; 128mb
gcmh-verbose nil))