diff --git a/modules/home/helix/home-helix-keys.ulu.nix b/modules/home/helix/home-helix-keys.ulu.nix index 9980d39..e20b39f 100644 --- a/modules/home/helix/home-helix-keys.ulu.nix +++ b/modules/home/helix/home-helix-keys.ulu.nix @@ -1,12 +1,35 @@ { ... }: { flake.homeModules.home-helix-keys = - { ... }: + { config, pkgs, ... }: let float = cmd: ":sh zellij run --floating --close-on-exit -- ${cmd}"; floatKeep = cmd: ":sh zellij run --floating -- ${cmd}"; + pick = pkgs.writeShellApplication { + name = "hx-pick"; + runtimeInputs = [ + pkgs.yazi + config.programs.zellij.finalPackage + pkgs.coreutils + ]; + text = '' + chooser=$(mktemp -t hx-pick.XXXXXX) + trap 'rm -f "$chooser"' EXIT + + yazi "''${1:-.}" --chooser-file="$chooser" + + picked=$(head -n 1 "$chooser") + [ -n "$picked" ] || exit 0 + + zellij action toggle-floating-panes + zellij action write-chars ":open '$picked'" + zellij action write 13 + ''; + }; in { + home.packages = [ pick ]; + programs.helix.settings.keys = { normal = { esc = [ @@ -18,7 +41,8 @@ q = ":buffer-close"; Q = ":quit"; t = float "nu"; - e = float "yazi"; + e = float "hx-pick"; + E = float "hx-pick %{buffer_name}"; n = ":sh zellij action new-tab"; z = ":sh zellij action toggle-floating-panes"; @@ -47,6 +71,15 @@ c = ":toggle cursorline"; f = ":toggle auto-format"; }; + + # language server + l = { + r = ":lsp-restart"; + s = ":lsp-stop"; + w = ":lsp-workspace-command"; + l = ":log-open"; + f = ":format"; + }; }; }; }; diff --git a/modules/home/helix/home-helix-language-servers.ulu.nix b/modules/home/helix/home-helix-language-servers.ulu.nix index 4befb1d..02fd469 100644 --- a/modules/home/helix/home-helix-language-servers.ulu.nix +++ b/modules/home/helix/home-helix-language-servers.ulu.nix @@ -50,6 +50,10 @@ # markdown marksman + # debug adapters (`space G`) + lldb # lldb-dap: rust, c, c++, zig + delve # dlv: go + # `editor.shell` path nushell wl-clipboard diff --git a/modules/home/helix/home-helix.ulu.nix b/modules/home/helix/home-helix.ulu.nix index 69f367e..7551e00 100644 --- a/modules/home/helix/home-helix.ulu.nix +++ b/modules/home/helix/home-helix.ulu.nix @@ -38,6 +38,8 @@ preview-completion-insert = true; trim-trailing-whitespace = true; trim-final-newlines = true; + editor-config = true; + completion-replace = true; end-of-line-diagnostics = "hint"; statusline = { @@ -71,6 +73,8 @@ display-progress-messages = true; display-inlay-hints = true; auto-signature-help = true; + inlay-hints-length-limit = 30; + goto-reference-include-declaration = false; }; cursor-shape = { diff --git a/modules/home/theme/home-theme-helix.ulu.nix b/modules/home/theme/home-theme-helix.ulu.nix index 9b9ba10..89d9e55 100644 --- a/modules/home/theme/home-theme-helix.ulu.nix +++ b/modules/home/theme/home-theme-helix.ulu.nix @@ -38,7 +38,7 @@ fg = "fgBright"; modifiers = [ "bold" ]; }; - "ui.window" = "bgSoft"; + "ui.window" = "gutter"; "ui.cursor" = { fg = "bg"; bg = "fgSoft"; @@ -193,6 +193,22 @@ }; "markup.link.text" = "blue"; "markup.raw" = "green"; + "markup.heading.marker" = "brown"; + "markup.list" = "magenta"; + "markup.quote" = { + fg = "fgSoft"; + modifiers = [ "italic" ]; + }; + "markup.link" = "blue"; + "markup.link.label" = "cyan"; + "markup.raw.inline" = { + fg = "green"; + bg = "bgAlt"; + }; + "markup.raw.block" = "green"; + "markup.strikethrough" = { + modifiers = [ "crossed_out" ]; + }; # diagnostics & diff "diagnostic.error" = { @@ -224,9 +240,99 @@ "info" = "blue"; "hint" = "cyan"; + "diagnostic.unnecessary" = { + modifiers = [ "dim" ]; + }; + "diagnostic.deprecated" = { + modifiers = [ "crossed_out" ]; + }; + "diff.plus" = "green"; "diff.minus" = "red"; "diff.delta" = "blue"; + "diff.plus.gutter" = "green"; + "diff.minus.gutter" = "red"; + "diff.delta.gutter" = "blue"; + + # ui — pickers, popups, jump labels + "ui.highlight" = { + bg = "bgSoft"; + modifiers = [ "bold" ]; + }; + "ui.highlight.frameline" = { + bg = "selectPrimary"; + }; + "ui.menu.scroll" = { + fg = "gray"; + bg = "bgAlt"; + }; + "ui.text.inactive" = "gray"; + "ui.text.info" = "fgSoft"; + "ui.text.directory" = "blue"; + "ui.background.separator" = "gutter"; + "ui.gutter.selected" = { + bg = "bgAlt"; + }; + "ui.cursorline" = { + bg = "bgAlt"; + }; + "ui.cursorcolumn.primary" = { + bg = "bgAlt"; + }; + + "ui.picker.header" = { + fg = "gray"; + modifiers = [ "bold" ]; + }; + "ui.picker.header.column" = "gray"; + "ui.picker.header.column.active" = { + fg = "orange"; + modifiers = [ "bold" ]; + }; + + "ui.virtual" = "gutter"; + # `gw`/`gW` labels were rendering in the underlying token colour. + "ui.virtual.jump-label" = { + fg = "bg"; + bg = "orange"; + modifiers = [ "bold" ]; + }; + "ui.virtual.wrap" = "gutter"; + "ui.virtual.inlay-hint.type" = "gray"; + "ui.virtual.inlay-hint.parameter" = "gray"; + + # mode-aware cursors, to match `color-modes` + "ui.cursor.normal" = { + fg = "bg"; + bg = "fgSoft"; + }; + "ui.cursor.insert" = { + fg = "bg"; + bg = "green"; + }; + "ui.cursor.select" = { + fg = "bg"; + bg = "magenta"; + }; + "ui.cursor.primary.normal" = { + fg = "bg"; + bg = "fgBright"; + }; + "ui.cursor.primary.insert" = { + fg = "bg"; + bg = "green"; + }; + "ui.cursor.primary.select" = { + fg = "bg"; + bg = "magenta"; + }; + + # dap + "ui.debug" = "orange"; + "ui.debug.breakpoint" = "red"; + "ui.debug.active" = "yellow"; + + "special" = "brown"; }; }; }