Skip to content

Commit 172b0b4

Browse files
Updates
1. clean up rust configs 2. Better nix configs 3. Snippit for an envrc
1 parent 0084b92 commit 172b0b4

File tree

3 files changed

+19
-13
lines changed

3 files changed

+19
-13
lines changed

modules/orary-misc.el

+6-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,12 @@
3636
(use-package lua-mode)
3737
(use-package php-mode)
3838
(use-package puppet-mode)
39-
(use-package nix-mode)
39+
40+
(use-package nix-mode
41+
:hook (nix-mode . lsp-deferred)
42+
:ensure t
43+
:custom
44+
(lsp-nix-nil-formatter ["nixpkgs-fmt"]))
4045

4146
;; (use-package systemd)
4247
;; (add-to-list 'auto-mode-alist '("\\.service\\'" . systemd-mode))

modules/orary-rust.el

+6-12
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
(require 'orary-braces)
88
(require 'orary-functions)
99

10-
(use-package cargo) ;; Build tool wrapper
10+
;; (use-package cargo)
11+
;; Build tool wrapper
1112
;; NOTE[rdonaldson|2023-04-29] I *think* LSP fully replaces racer.
1213
;;
1314
;; (use-package racer) ;; Symbol completion, introspection
@@ -77,8 +78,7 @@
7778
;; The Business
7879
(use-package rustic
7980
:config
80-
(setq cargo-process--command-clippy "clippy"
81-
;; NOTE[rdonaldson|2023-04-23] Dear future Ross: you are gonna think
81+
(setq ;; NOTE[rdonaldson|2023-04-23] Dear future Ross: you are gonna think
8282
;; this is a good idea, but you are wrong. With LSP, there's some
8383
;; interaction between LSP and rust-analyzer and format on save that
8484
;; ruins *everything*. Don't turn this back on until you get that sorted
@@ -87,21 +87,15 @@
8787
;; rust-format-on-save t
8888
lsp-rust-analyzer-cargo-watch-command "clippy"
8989
)
90-
(add-hook 'rust-mode-hook
90+
(add-hook 'rustic-mode-hook
9191
(lambda ()
9292
(cargo-minor-mode +1)
9393
(subword-mode +1)
94-
(lsp)
94+
(lsp-deferred)
9595
(flycheck-add-next-checker 'lsp 'rust-clippy)
9696
(setq comment-start "//")))
97-
98-
;; NOTE[rdonaldson|2023-04-29] I think LSP fully replaces racer.
99-
;;
100-
;; (add-hook 'racer-mode-hook #'eldoc-mode)
101-
;; (add-hook 'racer-mode-hook #'company-mode)
10297

103-
:bind (:map rust-mode-map
104-
("C-c C-c" . #'rust-compile)
98+
:bind (:map rustic-mode-map
10599
("<C-return>" . #'orary/rust-ret-dwim)
106100
("C-o" . #'orary/braces-open-newline)
107101
("-" . #'orary/rust-insert-arrow))

snippets/direnv-envrc-mode/envrc

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# -*- mode: snippet -*-
2+
# name: envrc
3+
# key: envrc
4+
# --
5+
#!/usr/bin/env bash
6+
7+
use flake

0 commit comments

Comments
 (0)