diff --git a/home/helix/default.nix b/home/helix/default.nix index 02dfad7..5859aaf 100644 --- a/home/helix/default.nix +++ b/home/helix/default.nix @@ -1,5 +1,6 @@ {...}: { imports = [ + ./languages.nix ./themes/catppuccin_mocha.nix ]; programs.helix = { @@ -7,9 +8,25 @@ settings = { theme = "catppuccin_mocha"; editor = { + auto-save = true; true-color = true; color-modes = true; cursorline = true; + completion-replace = true; + soft-wrap.enable = true; + idle-timeout = 1; + gutters = ["diff" "diagnostics" "line-numbers" "spacer"]; + statusline = { + left = ["mode" "spinner"]; + center = ["file-name"]; + right = ["diagnostics" "selections" "position" "file-line-ending" "file-type" "version-control"]; + separator = "|"; + mode = { + normal = "NORMAL"; + insert = "INSERT"; + select = "SELECT"; + }; + }; cursor-shape = { insert = "bar"; normal = "block"; @@ -18,37 +35,20 @@ indent-guides = { render = true; rainbow = "dim"; - - languages = [ - { - name = "nix"; - auto-format = true; - } - { - name = "rust"; - } - { - name = "go"; - } - { - name = "lua"; - } - { - name = "python"; - } - { - name = "markdown"; - } - { - name = "html"; - } - { - name = "css"; - } - { - name = "yaml"; - } - ]; + character = "┆"; + }; + whitespace = { + characters = { + space = "·"; + nbsp = "⍽"; + tab = "→"; + newline = "⏎"; + tabpad = "·"; + }; + }; + lsp = { + display-messages = true; + display-inlay-hints = true; }; }; }; diff --git a/home/helix/languages.nix b/home/helix/languages.nix new file mode 100644 index 0000000..ad9c1c3 --- /dev/null +++ b/home/helix/languages.nix @@ -0,0 +1,34 @@ +{ + pkgs, + lib, + ... +}: { + programs.helix.languages = { + language = with pkgs; [ + { + name = "nix"; + auto-format = true; + formatter = { + command = lib.getExe alejandra; + args = ["-q"]; + }; + } + { + name = "rust"; + auto-format = true; + formatter = { + command = lib.getExe rustfmt; + }; + } + ]; + language-server = with pkgs; { + nil = { + command = lib.getExe nil; + }; + vscode-css-language-server = { + command = "${nodePackages.vscode-css-languageserver-bin}/bin/css-languageserver"; + args = ["--stdio"]; + }; + }; + }; +}