eglot rust analyzer and other stuff

This commit is contained in:
mehbark 2025-07-05 16:23:11 -04:00
parent 6bb60bb4ed
commit dcdd2c0ca2
5 changed files with 52 additions and 52 deletions

View file

@ -20,11 +20,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1750372185, "lastModified": 1751569683,
"narHash": "sha256-lVBKxd9dsZOH1fA6kSE5WNnt8e+09fN+NL/Q3BjTWHY=", "narHash": "sha256-PoQcCYTiN52PanxgWBN4Tqet1x4PCk6KtjaHNjELH88=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "aquamarine", "repo": "aquamarine",
"rev": "7cef49d261cbbe537e8cb662485e76d29ac4cbca", "rev": "c0c56dde3e471030edb135425a82107cf0057c6f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -149,11 +149,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1749154018, "lastModified": 1751468302,
"narHash": "sha256-gjN3j7joRvT3a8Zgcylnd4NFsnXeDBumqiu4HmY1RIg=", "narHash": "sha256-tWosziZTT039x6PgEZUhzGlV8oLvdDmIgKTE8ESMaEA=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "7aae0ee71a17b19708b93b3ed448a1a0952bf111", "rev": "501cfec8277f931a9c9af9f23d3105c537faeafe",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -208,11 +208,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1750371717, "lastModified": 1750621377,
"narHash": "sha256-cNP+bVq8m5x2Rl6MTjwfQLCdwbVmKvTH7yqVc1SpiJM=", "narHash": "sha256-8u6b5oAdX0rCuoR8wFenajBRmI+mzbpNig6hSCuWUzE=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprgraphics", "repo": "hyprgraphics",
"rev": "15c6f8f3a567fec9a0f732cd310a7ff456deef88", "rev": "b3d628d01693fb9bb0a6690cd4e7b80abda04310",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -237,11 +237,11 @@
"xdph": "xdph" "xdph": "xdph"
}, },
"locked": { "locked": {
"lastModified": 1750515748, "lastModified": 1751633026,
"narHash": "sha256-8xDci/Xb/u2FczbO9xwIs3vS8N81O3o38F3XGgoizNI=", "narHash": "sha256-36YOErrM/BB8J/IpqgAg7CNZfAlfU7Mng1S9Y9OFOmc=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "Hyprland", "repo": "Hyprland",
"rev": "238887473866a63c0fd70ead614f37ac86333e28", "rev": "9b51d73a1e22c86e8d6ec78750e622da9242e32f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -384,11 +384,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1750371096, "lastModified": 1751061882,
"narHash": "sha256-JB1IeJ41y7kWc/dPGV6RMcCUM0Xj2NEK26A2Ap7EM9c=", "narHash": "sha256-g9n8Vrbx+2JYM170P9BbvGHN39Wlkr4U+V2WLHQsXL8=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprutils", "repo": "hyprutils",
"rev": "38f3a211657ce82a1123bf19402199b67a410f08", "rev": "4737241eaf8a1e51671a2a088518071f9a265cf4",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -449,11 +449,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1750325256, "lastModified": 1751313918,
"narHash": "sha256-vvlxGz/waqJ3TGqM/iqXbnEc7/R1qnEXmaBiPaQ1RE0=", "narHash": "sha256-HsJM3XLa43WpG+665aGEh8iS8AfEwOIQWk3Mke3e7nk=",
"owner": "LnL7", "owner": "LnL7",
"repo": "nix-darwin", "repo": "nix-darwin",
"rev": "0d71cbf88d63e938b37b85b3bf8b238bcf7b39b9", "rev": "e04a388232d9a6ba56967ce5b53a8a6f713cdfcf",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -514,11 +514,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1750365781, "lastModified": 1751011381,
"narHash": "sha256-XE/lFNhz5lsriMm/yjXkvSZz5DfvKJLUjsS6pP8EC50=", "narHash": "sha256-krGXKxvkBhnrSC/kGBmg5MyupUUT5R6IBCLEzx9jhMM=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "08f22084e6085d19bcfb4be30d1ca76ecb96fe54", "rev": "30e2e2857ba47844aa71991daa6ed1fc678bcbb7",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -530,11 +530,11 @@
}, },
"nixpkgs_3": { "nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1750400657, "lastModified": 1751479989,
"narHash": "sha256-3vkjFnxCOP6vm5Pm13wC/Zy6/VYgei/I/2DWgW4RFeA=", "narHash": "sha256-M5KgdpVBVcW4HRVq9/OSRbrxlwsQ1ogEKqnvzsClDqU=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "b2485d56967598da068b5a6946dadda8bfcbcd37", "rev": "34627c90f062da515ea358360f448da57769236e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -575,11 +575,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1749636823, "lastModified": 1750779888,
"narHash": "sha256-WUaIlOlPLyPgz9be7fqWJA5iG6rHcGRtLERSCfUDne4=", "narHash": "sha256-wibppH3g/E2lxU43ZQHC5yA/7kIKLGxVEnsnVK1BtRg=",
"owner": "cachix", "owner": "cachix",
"repo": "git-hooks.nix", "repo": "git-hooks.nix",
"rev": "623c56286de5a3193aa38891a6991b28f9bab056", "rev": "16ec914f6fb6f599ce988427d9d94efddf25fe6d",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -55,6 +55,7 @@ in
lua lua
sageWithDoc sageWithDoc
zls zls
rustup
# might as well use it consistently # might as well use it consistently
haskell-language-server haskell-language-server
@ -108,7 +109,6 @@ in
# ]; # ];
# })) # }))
pkg-config pkg-config
rustup
podman podman
wget wget
] else [ ] else [
@ -134,10 +134,6 @@ in
libsForQt5.khotkeys libsForQt5.khotkeys
libsForQt5.kio libsForQt5.kio
helm helm
cargo
clippy
rustc
rustfmt
inotify-tools inotify-tools
]); ]);

View file

@ -219,12 +219,6 @@ If the new path's directories does not exist, create them."
;; Nice line wrapping when working with text ;; Nice line wrapping when working with text
(add-hook 'text-mode-hook 'visual-line-mode) (add-hook 'text-mode-hook 'visual-line-mode)
;; mix format
(add-hook 'after-save-hook
'(lambda ()
(when (eq major-mode 'elixir-ts-mode)
(shell-command-to-string (format "mix format %s" (buffer-file-name))))))
;; Modes to highlight the current line with ;; Modes to highlight the current line with
(let ((hl-line-hooks '(text-mode-hook prog-mode-hook))) (let ((hl-line-hooks '(text-mode-hook prog-mode-hook)))
(mapc (lambda (hook) (add-hook hook 'hl-line-mode)) hl-line-hooks)) (mapc (lambda (hook) (add-hook hook 'hl-line-mode)) hl-line-hooks))
@ -489,11 +483,14 @@ If the new path's directories does not exist, create them."
(json-mode . json-ts-mode) (json-mode . json-ts-mode)
(css-mode . css-ts-mode) (css-mode . css-ts-mode)
(python-mode . python-ts-mode) (python-mode . python-ts-mode)
(elixir-mode . elixir-ts-mode))) (elixir-mode . elixir-ts-mode)
(rust-mode . rust-ts-mode)))
(add-to-list 'auto-mode-alist (add-to-list 'auto-mode-alist
'("\\.ex\\'" . elixir-mode)) '("\\.ex\\'" . elixir-mode))
(add-to-list 'auto-mode-alist (add-to-list 'auto-mode-alist
'("\\.exs\\'" . elixir-mode)) '("\\.exs\\'" . elixir-mode))
(add-to-list 'auto-mode-alist
'("\\.rs\\'" . rust-mode))
:hook :hook
;; Auto parenthesis matching ;; Auto parenthesis matching
@ -538,25 +535,22 @@ If the new path's directories does not exist, create them."
(use-package eglot (use-package eglot
;; no :ensure t here because it's built-in ;; no :ensure t here because it's built-in
;; Configure hooks to automatically turn-on eglot for selected modes
:hook :hook
; (((python-mode ruby-mode) . eglot)) (rust-mode . eglot-ensure)
((elixir-ts-mode . eglot-ensure) (before-save . eglot-format)
(rust-mode . eglot-ensure))
:custom
;; let's try a higher idle time, elixir-ls is a bit finicky
(eglot-send-changes-idle-time 0.5)
:config :config
(fset #'jsonrpc--log-event #'ignore) ; massive perf boost---don't log every event ; (fset #'jsonrpc--log-event #'ignore) ; massive perf boost---don't log every event
;; Sometimes you need to tell Eglot where to find the language server ;; Sometimes you need to tell Eglot where to find the language server
(add-to-list 'eglot-server-programs (add-to-list 'eglot-server-programs
'(elixir-ts-mode "${pkgs.elixir-ls}/bin/elixir-ls")) '(elixir-ts-mode "${pkgs.elixir-ls}/bin/elixir-ls"))
; i could nixify the rust-analyzer bin path buuuut ; i could nixify the rust-analyzer bin path buuuut
(add-to-list 'eglot-server-programs (add-to-list 'eglot-server-programs
'((rust-ts-mode rust-mode) . '((rust-ts-mode rust-mode) .
("rust-analyzer" :initializationOptions (:check (:command "clippy"))))) ("rust-analyzer" :initializationOptions
(:check (:command "clippy"
:extraArgs ["--" "-W" "clippy::pedantic"])))))
) )
; oorg ; oorg
@ -988,6 +982,16 @@ If the new path's directories does not exist, create them."
; haskell ; haskell
"hg" 'haskell-hoogle "hg" 'haskell-hoogle
; lsp (eglot)
"la" 'eglot-code-actions
"lf" 'eglot-code-action-quickfix
"li" 'eglot-inlay-hints-mode
"lh" 'eldoc
"lr" 'eglot-rename
"ld" 'xref-find-definitions
"ln" 'imenu
"lE" 'eglot
)) ))
(use-package evil-goggles (use-package evil-goggles

View file

@ -1109,7 +1109,7 @@ color15 #ebdbb2
#: Advanced {{{ #: Advanced {{{
# shell fish shell nu
#: The shell program to execute. The default value of . means to use #: The shell program to execute. The default value of . means to use
#: whatever shell is set as the default shell for the current user. #: whatever shell is set as the default shell for the current user.

View file

@ -129,8 +129,8 @@
"ruby.format" = "prettier"; "ruby.format" = "prettier";
"ruby.intellisense" = "rubyLocate"; "ruby.intellisense" = "rubyLocate";
"rust-analyzer.server.path" = "${pkgs.rust-analyzer}/bin/rust-analyzer"; "rust-analyzer.server.path" = "${pkgs.rust-analyzer}/bin/rust-analyzer";
"rust-analyzer.checkOnSave.command" = "clippy"; "rust-analyzer.check.command" = "clippy";
"rust-analyzer.checkOnSave.extraArgs" = [ "--" "-W" "clippy::pedantic" ]; "rust-analyzer.check.extraArgs" = [ "--" "-W" "clippy::pedantic" ];
"rust-analyzer.debug.openDebugPane" = true; "rust-analyzer.debug.openDebugPane" = true;
"rust-analyzer.inlayHints.closureReturnTypeHints.enable" = "always"; "rust-analyzer.inlayHints.closureReturnTypeHints.enable" = "always";
"rust-analyzer.inlayHints.lifetimeElisionHints.enable" = "always"; "rust-analyzer.inlayHints.lifetimeElisionHints.enable" = "always";