From 9ae3e9f6fcc330fce2af5209398356693cd51346 Mon Sep 17 00:00:00 2001 From: itsscb Date: Thu, 20 Jun 2024 22:25:14 +0200 Subject: [PATCH] fix/helix language-server rust --- dotfiles/helix/languages.toml | 21 ++++++------- home.nix | 58 +++++------------------------------ nixos-switch.log | 1 - 3 files changed, 18 insertions(+), 62 deletions(-) delete mode 100644 nixos-switch.log diff --git a/dotfiles/helix/languages.toml b/dotfiles/helix/languages.toml index 7b2a326..e561533 100644 --- a/dotfiles/helix/languages.toml +++ b/dotfiles/helix/languages.toml @@ -13,24 +13,23 @@ roots = [ '[' = ']' '"' = '"' '`' = '`' -'<' = '>' [language-server.rust-analyzer] command = "rust-analyzer" -[language-server.rust-analyzer.config.check] -config.check.command = "clippy" - [language-server.rust-analyzer.config] +inlayHints.bindingModeHints.enable = true inlayHints.closingBraceHints.minLines = 10 inlayHints.closureReturnTypeHints.enable = "with_block" +inlayHints.discriminantHints.enable = "fieldless" +inlayHints.lifetimeElisionHints.enable = "skip_trivial" inlayHints.typeHints.hideClosureInitialization = false -# inlayHints.bindingModeHints.enable = false -# inlayHints.discriminantHints.enable = "fieldless" -# inlayHints.lifetimeElisionHints.enable = "skip_trivial" +diagnostics.enableInlineHints = true + +check.command = "clippy" +checkOnSave.command = "clippy" + +[keys.normal] +C-t = ":run-shell-command cargo test -- --nocapture" -[[language]] -name = "go" -auto-format = true -formatter = { command = "goimports" } diff --git a/home.nix b/home.nix index e7f7c7c..06b1ff4 100644 --- a/home.nix +++ b/home.nix @@ -77,50 +77,6 @@ helix = { enable = true; defaultEditor = true; - # languages = { - # rust = { - # enable = true; - # language-servers = ["rust-analyzer"]; - # language-server.rust-analyzer = { - # command = "rustup run rust-analyzer"; - # config = { - # check.command = "clippy"; - # # diagnostics.disabled = ["inactive-code"]; - # diagnostics.enableInlineHints = true; - # # inlay-hints.enabled = true; - # # inlay-hints.max-length = 25; - # # lens.enabled = true; - # # lens.run.enable = true; - # # completion.postfix.enable = true; - # # assist.importMergeBehavior = "full"; - # # callInfo.full = true; - # }; - # }; - # }; - # }; - languages = { - rust = { - enable = true; - language-servers = ["rust-analyzer"]; - language-server = { - rust-analyzer = { - # command = "rust-analyzer"; - command = "rustup run rust-analyzer"; - config = { - check.command = "clippy"; - diagnostics.enableInlineHints = true; - inlay-hints.enabled = true; - # inlay-hints.max-length = 25; - lens.enabled = true; - lens.run.enable = true; - completion.postfix.enable = true; - assist.importMergeBehavior = "full"; - callInfo.full = true; - }; - }; - }; - }; -}; settings = { theme = "onedark"; editor = { @@ -129,6 +85,8 @@ auto-completion = true; auto-save = true; auto-format = true; + soft-wrap.enable = true; + soft-wrap.max-indent-retain = 80; cursorline = true; gutters = [ "diff" @@ -181,14 +139,13 @@ }; keys.insert.j.k = "normal_mode"; keys.insert."C-c" = "normal_mode"; + keys.insert."C-right" = ["move_next_word_end" "move_char_right"]; + keys.insert."C-left" = "move_prev_word_start"; keys.normal.g.a = "code_action"; - keys.normal.backspace = { - r = ":run-shell-command cargo run"; - t = ":run-shell-command cargo test"; - b = ":run-shell-command cargo build"; - c = ":run-shell-command cargo check"; - }; + keys.normal."C-s" = ":w"; + keys.normal."C-right" = ["move_next_word_end" "move_char_right"]; + keys.normal."C-left" = "move_prev_word_start"; }; }; @@ -389,6 +346,7 @@ home.file = { ".config/hypr/hyprlock.conf".source = ./dotfiles/hypr/hyprlock.conf; ".config/waybar".source = ./dotfiles/waybar; + ".config/helix/languages.toml".source = ./dotfiles/helix/languages.toml; ".config/rofi/config.rasi".source = ./dotfiles/rofi/config.rasi; }; diff --git a/nixos-switch.log b/nixos-switch.log deleted file mode 100644 index d09dd9c..0000000 --- a/nixos-switch.log +++ /dev/null @@ -1 +0,0 @@ -building the system configuration...