This commit is contained in:
2025-08-29 15:25:40 +02:00
parent 26440bfeee
commit f3821f0dfa
201 changed files with 2461 additions and 1546 deletions

View File

@@ -4,10 +4,12 @@
lib,
config,
...
}: let
}:
let
inherit (lib) mkIf mkEnableOption;
cfg = config.home.programs.helix;
in {
in
{
imports = [
./languages.nix
./gruvbox.nix
@@ -46,7 +48,12 @@ in {
display-messages = true;
display-inlay-hints = true;
};
gutters = ["diagnostics" "line-numbers" "spacer" "diff"];
gutters = [
"diagnostics"
"line-numbers"
"spacer"
"diff"
];
statusline = {
separator = "/";
left = [
@@ -57,7 +64,7 @@ in {
"spinner"
"diagnostics"
];
center = ["file-name"];
center = [ "file-name" ];
right = [
"file-encoding"
"file-line-ending"
@@ -78,62 +85,103 @@ in {
};
};
keys = let
spaceMode = {
space = "file_picker";
n = "global_search";
f = ":format";
c = "toggle_comments";
t = {
d = "goto_type_definition";
i = "goto_implementation";
r = "goto_reference";
t = "goto_definition";
w = "trim_selections";
keys =
let
spaceMode = {
space = "file_picker";
n = "global_search";
f = ":format";
c = "toggle_comments";
t = {
d = "goto_type_definition";
i = "goto_implementation";
r = "goto_reference";
t = "goto_definition";
w = "trim_selections";
};
x = ":buffer-close";
w = ":w";
q = ":q";
y = "yank";
p = "paste_after";
P = "paste_before";
R = "replace_with_yanked";
};
x = ":buffer-close";
w = ":w";
q = ":q";
y = "yank";
p = "paste_after";
P = "paste_before";
R = "replace_with_yanked";
};
in {
normal = {
d = {
d = ["extend_to_line_bounds" "yank_main_selection_to_clipboard" "delete_selection"];
s = ["surround_delete"];
in
{
normal = {
d = {
d = [
"extend_to_line_bounds"
"yank_main_selection_to_clipboard"
"delete_selection"
];
s = [ "surround_delete" ];
};
x = "delete_selection";
y = {
y = [
"extend_to_line_bounds"
"yank_main_selection_to_clipboard"
"normal_mode"
"collapse_selection"
];
d = ":yank-diagnostic";
};
Y = [
"extend_to_line_end"
"yank_main_selection_to_clipboard"
"collapse_selection"
];
P = [
"paste_clipboard_before"
"collapse_selection"
];
p = [
"paste_clipboard_after"
"collapse_selection"
];
C-a = "select_all";
del = "delete_selection";
space = spaceMode;
};
x = "delete_selection";
y = {
y = ["extend_to_line_bounds" "yank_main_selection_to_clipboard" "normal_mode" "collapse_selection"];
d = ":yank-diagnostic";
insert = {
C-v = "paste_clipboard_after";
C-c = "yank_to_clipboard";
C-x = "completion";
del = "delete_selection";
esc = [
"collapse_selection"
"normal_mode"
];
};
select = {
space = spaceMode;
d = [
"yank_main_selection_to_clipboard"
"delete_selection"
];
x = [
"yank_main_selection_to_clipboard"
"delete_selection"
];
y = [
"yank_main_selection_to_clipboard"
"normal_mode"
"flip_selections"
"collapse_selection"
];
Y = [
"extend_to_line_bounds"
"yank_main_selection_to_clipboard"
"goto_line_start"
"collapse_selection"
"normal_mode"
];
p = [ "replace_selections_with_clipboard" ];
P = [ "paste_clipboard_before" ];
};
Y = ["extend_to_line_end" "yank_main_selection_to_clipboard" "collapse_selection"];
P = ["paste_clipboard_before" "collapse_selection"];
p = ["paste_clipboard_after" "collapse_selection"];
C-a = "select_all";
del = "delete_selection";
space = spaceMode;
};
insert = {
C-v = "paste_clipboard_after";
C-c = "yank_to_clipboard";
C-x = "completion";
del = "delete_selection";
esc = ["collapse_selection" "normal_mode"];
};
select = {
space = spaceMode;
d = ["yank_main_selection_to_clipboard" "delete_selection"];
x = ["yank_main_selection_to_clipboard" "delete_selection"];
y = ["yank_main_selection_to_clipboard" "normal_mode" "flip_selections" "collapse_selection"];
Y = ["extend_to_line_bounds" "yank_main_selection_to_clipboard" "goto_line_start" "collapse_selection" "normal_mode"];
p = ["replace_selections_with_clipboard"];
P = ["paste_clipboard_before"];
};
};
};
};
};

View File

@@ -1,201 +1,225 @@
{
programs.helix.themes = {
gruvbox_custom = let
bg0 = "#32302f";
bg1 = "#3c3836";
bg2 = "#3c3836";
bg3 = "#504945";
bg4 = "#504945";
fg0 = "#d4be98";
red = "#ea6962";
orange = "#e78a4e";
yellow = "#d8a657";
bg_visual_yellow = "#574833";
green = "#a9b665";
aqua = "#89b482";
blue = "#7daea3";
purple = "#d3869b";
grey0 = "#7c6f64";
grey2 = "#a89984";
in {
"type" = yellow;
"constant" = purple;
"constant.numeric" = purple;
"constant.character.escape" = orange;
"string" = green;
"string.regexp" = blue;
"comment" = grey0;
"variable" = fg0;
"variable.builtin" = blue;
"variable.parameter" = fg0;
"variable.other.member" = fg0;
"label" = aqua;
"punctuation" = grey2;
"punctuation.delimiter" = grey2;
"punctuation.bracket" = fg0;
"keyword" = red;
"keyword.directive" = aqua;
"operator" = orange;
"function" = green;
"function.builtin" = blue;
"function.macro" = aqua;
"tag" = yellow;
"namespace" = aqua;
"attribute" = aqua;
"constructor" = yellow;
"module" = blue;
"special" = orange;
"markup.heading.marker" = grey2;
"markup.heading.1" = {
fg = red;
modifiers = ["bold"];
};
"markup.heading.2" = {
fg = orange;
modifiers = ["bold"];
};
"markup.heading.3" = {
fg = yellow;
modifiers = ["bold"];
};
"markup.heading.4" = {
fg = green;
modifiers = ["bold"];
};
"markup.heading.5" = {
fg = blue;
modifiers = ["bold"];
};
"markup.heading.6" = {
fg = fg0;
modifiers = ["bold"];
};
"markup.list" = red;
"markup.bold" = {modifiers = ["bold"];};
"markup.italic" = {modifiers = ["italic"];};
"markup.link.url" = {
fg = blue;
modifiers = ["underlined"];
};
"markup.link.text" = purple;
"markup.quote" = grey2;
"markup.raw" = green;
gruvbox_custom =
let
bg0 = "#32302f";
bg1 = "#3c3836";
bg2 = "#3c3836";
bg3 = "#504945";
bg4 = "#504945";
fg0 = "#d4be98";
red = "#ea6962";
orange = "#e78a4e";
yellow = "#d8a657";
bg_visual_yellow = "#574833";
green = "#a9b665";
aqua = "#89b482";
blue = "#7daea3";
purple = "#d3869b";
grey0 = "#7c6f64";
grey2 = "#a89984";
in
{
"type" = yellow;
"constant" = purple;
"constant.numeric" = purple;
"constant.character.escape" = orange;
"string" = green;
"string.regexp" = blue;
"comment" = grey0;
"variable" = fg0;
"variable.builtin" = blue;
"variable.parameter" = fg0;
"variable.other.member" = fg0;
"label" = aqua;
"punctuation" = grey2;
"punctuation.delimiter" = grey2;
"punctuation.bracket" = fg0;
"keyword" = red;
"keyword.directive" = aqua;
"operator" = orange;
"function" = green;
"function.builtin" = blue;
"function.macro" = aqua;
"tag" = yellow;
"namespace" = aqua;
"attribute" = aqua;
"constructor" = yellow;
"module" = blue;
"special" = orange;
"markup.heading.marker" = grey2;
"markup.heading.1" = {
fg = red;
modifiers = [ "bold" ];
};
"markup.heading.2" = {
fg = orange;
modifiers = [ "bold" ];
};
"markup.heading.3" = {
fg = yellow;
modifiers = [ "bold" ];
};
"markup.heading.4" = {
fg = green;
modifiers = [ "bold" ];
};
"markup.heading.5" = {
fg = blue;
modifiers = [ "bold" ];
};
"markup.heading.6" = {
fg = fg0;
modifiers = [ "bold" ];
};
"markup.list" = red;
"markup.bold" = {
modifiers = [ "bold" ];
};
"markup.italic" = {
modifiers = [ "italic" ];
};
"markup.link.url" = {
fg = blue;
modifiers = [ "underlined" ];
};
"markup.link.text" = purple;
"markup.quote" = grey2;
"markup.raw" = green;
"diff.plus" = green;
"diff.delta" = orange;
"diff.minus" = red;
"diff.plus" = green;
"diff.delta" = orange;
"diff.minus" = red;
"ui.background" = {bg = bg0;};
"ui.background.separator" = grey0;
"ui.cursor" = {
fg = bg0;
bg = fg0;
};
"ui.cursor.match" = {
fg = orange;
bg = bg_visual_yellow;
};
"ui.cursor.insert" = {
fg = bg0;
bg = grey2;
};
"ui.cursor.select" = {
fg = bg0;
bg = blue;
};
"ui.cursorline.primary" = {bg = bg1;};
"ui.cursorline.secondary" = {bg = bg1;};
"ui.selection" = {bg = bg3;};
"ui.linenr" = grey0;
"ui.linenr.selected" = fg0;
"ui.statusline" = {
fg = fg0;
bg = bg3;
};
"ui.statusline.inactive" = {
fg = grey0;
bg = bg1;
};
"ui.statusline.normal" = {
fg = bg0;
bg = fg0;
modifiers = ["bold"];
};
"ui.statusline.insert" = {
fg = bg0;
bg = yellow;
modifiers = ["bold"];
};
"ui.statusline.select" = {
fg = bg0;
bg = blue;
modifiers = ["bold"];
};
"ui.bufferline" = {
fg = grey0;
bg = bg1;
};
"ui.bufferline.active" = {
fg = fg0;
bg = bg3;
modifiers = ["bold"];
};
"ui.popup" = {
fg = grey2;
bg = bg2;
};
"ui.window" = {
fg = grey0;
bg = bg0;
};
"ui.help" = {
fg = fg0;
bg = bg2;
};
"ui.text" = fg0;
"ui.text.focus" = fg0;
"ui.menu" = {
fg = fg0;
bg = bg3;
};
"ui.menu.selected" = {
fg = bg0;
bg = blue;
modifiers = ["bold"];
};
"ui.virtual.whitespace" = {fg = bg4;};
"ui.virtual.indent-guide" = {fg = bg4;};
"ui.virtual.ruler" = {bg = bg3;};
"ui.background" = {
bg = bg0;
};
"ui.background.separator" = grey0;
"ui.cursor" = {
fg = bg0;
bg = fg0;
};
"ui.cursor.match" = {
fg = orange;
bg = bg_visual_yellow;
};
"ui.cursor.insert" = {
fg = bg0;
bg = grey2;
};
"ui.cursor.select" = {
fg = bg0;
bg = blue;
};
"ui.cursorline.primary" = {
bg = bg1;
};
"ui.cursorline.secondary" = {
bg = bg1;
};
"ui.selection" = {
bg = bg3;
};
"ui.linenr" = grey0;
"ui.linenr.selected" = fg0;
"ui.statusline" = {
fg = fg0;
bg = bg3;
};
"ui.statusline.inactive" = {
fg = grey0;
bg = bg1;
};
"ui.statusline.normal" = {
fg = bg0;
bg = fg0;
modifiers = [ "bold" ];
};
"ui.statusline.insert" = {
fg = bg0;
bg = yellow;
modifiers = [ "bold" ];
};
"ui.statusline.select" = {
fg = bg0;
bg = blue;
modifiers = [ "bold" ];
};
"ui.bufferline" = {
fg = grey0;
bg = bg1;
};
"ui.bufferline.active" = {
fg = fg0;
bg = bg3;
modifiers = [ "bold" ];
};
"ui.popup" = {
fg = grey2;
bg = bg2;
};
"ui.window" = {
fg = grey0;
bg = bg0;
};
"ui.help" = {
fg = fg0;
bg = bg2;
};
"ui.text" = fg0;
"ui.text.focus" = fg0;
"ui.menu" = {
fg = fg0;
bg = bg3;
};
"ui.menu.selected" = {
fg = bg0;
bg = blue;
modifiers = [ "bold" ];
};
"ui.virtual.whitespace" = {
fg = bg4;
};
"ui.virtual.indent-guide" = {
fg = bg4;
};
"ui.virtual.ruler" = {
bg = bg3;
};
"hint" = blue;
"info" = aqua;
"warning" = yellow;
"error" = red;
"diagnostic" = {underline = {style = "curl";};};
"diagnostic.hint" = {
underline = {
color = blue;
style = "dotted";
"hint" = blue;
"info" = aqua;
"warning" = yellow;
"error" = red;
"diagnostic" = {
underline = {
style = "curl";
};
};
"diagnostic.hint" = {
underline = {
color = blue;
style = "dotted";
};
};
"diagnostic.info" = {
underline = {
color = aqua;
style = "dotted";
};
};
"diagnostic.warning" = {
underline = {
color = yellow;
style = "curl";
};
};
"diagnostic.error" = {
underline = {
color = red;
style = "curl";
};
};
};
"diagnostic.info" = {
underline = {
color = aqua;
style = "dotted";
};
};
"diagnostic.warning" = {
underline = {
color = yellow;
style = "curl";
};
};
"diagnostic.error" = {
underline = {
color = red;
style = "curl";
};
};
};
};
}

View File

@@ -2,31 +2,48 @@
pkgs,
lib,
...
}: {
}:
{
programs.helix.languages = {
language = let
deno = lang: {
command = lib.getExe pkgs.deno;
args = ["fmt" "-" "--ext" lang];
};
language =
let
deno = lang: {
command = lib.getExe pkgs.deno;
args = [
"fmt"
"-"
"--ext"
lang
];
};
prettier = lang: {
command = "prettier";
args = ["--parser" lang];
};
prettierLangs = map (e: {
name = e;
formatter = prettier e;
});
langs = ["css" "scss" "html"];
in
prettier = lang: {
command = "prettier";
args = [
"--parser"
lang
];
};
prettierLangs = map (e: {
name = e;
formatter = prettier e;
});
langs = [
"css"
"scss"
"html"
];
in
[
{
name = "bash";
auto-format = true;
formatter = {
command = lib.getExe pkgs.shfmt;
args = ["-i" "2"];
args = [
"-i"
"2"
];
};
}
{
@@ -36,7 +53,17 @@
{
name = "clojure";
injection-regex = "(clojure|clj|edn|boot|yuck)";
file-types = ["clj" "cljs" "cljc" "clje" "cljr" "cljx" "edn" "boot" "yuck"];
file-types = [
"clj"
"cljs"
"cljc"
"clje"
"cljr"
"cljx"
"edn"
"boot"
"yuck"
];
}
# {
# name = "cmake";
@@ -50,7 +77,7 @@
{
name = "lua";
auto-format = true;
language-servers = ["lua-language-server"];
language-servers = [ "lua-language-server" ];
formatter = {
command = lib.getExe pkgs.stylua;
};
@@ -66,7 +93,7 @@
}
{
name = "common-lisp";
file-types = ["kbd"];
file-types = [ "kbd" ];
auto-format = true;
}
{
@@ -77,10 +104,10 @@
{
name = "nix";
auto-format = true;
language-servers = ["nil"];
language-servers = [ "nil" ];
formatter = {
command = "${pkgs.nixfmt}/bin/nixfmt";
args = ["-q"];
args = [ "-q" ];
};
}
# {
@@ -94,7 +121,7 @@
{
name = "qml";
auto-format = true;
language-servers = ["qmlls"];
language-servers = [ "qmlls" ];
}
# {
# name = "typescript";
@@ -112,13 +139,13 @@
{
name = "css";
auto-format = true;
language-servers = ["vscode-css-language-server"];
language-servers = [ "vscode-css-language-server" ];
}
{
name = "rust";
auto-format = true;
file-types = ["rs"];
language-servers = ["rust-analyzer"];
file-types = [ "rs" ];
language-servers = [ "rust-analyzer" ];
formatter = {
command = lib.getExe pkgs.rustfmt;
};
@@ -129,17 +156,17 @@
language-server = {
phpactor = {
command = lib.getExe pkgs.phpactor;
args = ["language-server"];
args = [ "language-server" ];
};
bash-language-server = {
command = lib.getExe pkgs.bash-language-server;
args = ["start"];
args = [ "start" ];
};
clangd = {
command = "${pkgs.clang-tools}/bin/clangd";
clangd.fallbackFlags = ["-std=c++2b"];
clangd.fallbackFlags = [ "-std=c++2b" ];
};
# cmake-language-server = {
@@ -152,7 +179,7 @@
deno-lsp = {
command = lib.getExe pkgs.deno;
args = ["lsp"];
args = [ "lsp" ];
environment.NO_COLOR = "1";
config.deno = {
enable = true;
@@ -160,7 +187,9 @@
unstable = true;
suggest = {
completeFunctionCalls = false;
imports = {hosts."https://deno.land" = true;};
imports = {
hosts."https://deno.land" = true;
};
};
inlayHints = {
enumMemberValues.enabled = true;
@@ -180,7 +209,7 @@
qmlls = {
command = "${pkgs.qt6.qtdeclarative}/bin/qmlls";
args = ["-E"];
args = [ "-E" ];
};
# pyright = {
@@ -197,36 +226,38 @@
typescript-language-server = {
command = lib.getExe pkgs.nodePackages.typescript-language-server;
args = ["--stdio"];
config = let
inlayHints = {
includeInlayEnumMemberValueHints = true;
includeInlayFunctionLikeReturnTypeHints = true;
includeInlayFunctionParameterTypeHints = true;
includeInlayParameterNameHints = "all";
includeInlayParameterNameHintsWhenArgumentMatchesName = true;
includeInlayPropertyDeclarationTypeHints = true;
includeInlayVariableTypeHints = true;
};
in {
typescript-language-server.source = {
addMissingImports.ts = true;
fixAll.ts = true;
organizeImports.ts = true;
removeUnusedImports.ts = true;
sortImports.ts = true;
};
args = [ "--stdio" ];
config =
let
inlayHints = {
includeInlayEnumMemberValueHints = true;
includeInlayFunctionLikeReturnTypeHints = true;
includeInlayFunctionParameterTypeHints = true;
includeInlayParameterNameHints = "all";
includeInlayParameterNameHintsWhenArgumentMatchesName = true;
includeInlayPropertyDeclarationTypeHints = true;
includeInlayVariableTypeHints = true;
};
in
{
typescript-language-server.source = {
addMissingImports.ts = true;
fixAll.ts = true;
organizeImports.ts = true;
removeUnusedImports.ts = true;
sortImports.ts = true;
};
typescript = {inherit inlayHints;};
javascript = {inherit inlayHints;};
typescript = { inherit inlayHints; };
javascript = { inherit inlayHints; };
hostInfo = "helix";
};
hostInfo = "helix";
};
};
vscode-css-language-server = {
command = "${pkgs.vscode-langservers-extracted}/bin/vscode-css-language-server";
args = ["--stdio"];
args = [ "--stdio" ];
config = {
provideFormatter = true;
css.validate.enable = true;