NOflake/users/tao/helix.nix

262 lines
6.2 KiB
Nix
Raw Normal View History

2024-02-24 02:30:17 -08:00
{
inputs,
pkgs,
...
}: {
2024-01-30 10:46:26 -08:00
programs.helix = {
settings = {
2024-04-22 12:38:23 -07:00
theme = "gruvbox_dark_hard";
2024-01-30 10:46:26 -08:00
editor = {
2025-02-20 23:37:01 -08:00
end-of-line-diagnostics = "hint";
inline-diagnostics = {
cursor-line = "warning";
};
2025-02-20 14:55:55 -08:00
auto-save = {
2025-02-25 17:29:04 -08:00
focus-lost = false;
after-delay.enable = false;
2025-02-20 14:55:55 -08:00
after-delay.timeout = 1000;
};
2024-09-21 17:31:00 -07:00
shell = ["nu" "--stdin" "-c"];
2024-04-02 18:11:12 -07:00
# rainbow-brackets = true;
2024-01-30 10:46:26 -08:00
line-number = "relative";
cursorline = true;
2025-01-23 17:57:22 -08:00
completion-replace = false;
2024-01-30 10:46:26 -08:00
preview-completion-insert = false;
indent-guides = {
render = true;
skip-levels = 2;
};
cursor-shape = {
insert = "bar";
select = "underline";
};
statusline = {
2024-02-24 02:30:17 -08:00
left = ["mode" "spinner" "spacer" "version-control"];
center = ["file-name" "file-modification-indicator"];
right = ["diagnostics" "primary-selection-length" "total-line-numbers" "selections" "position"];
2024-01-30 10:46:26 -08:00
};
lsp = {
display-messages = true;
display-inlay-hints = true;
2025-02-20 23:37:01 -08:00
display-progress-messages = true;
2024-01-30 10:46:26 -08:00
};
2024-01-31 17:34:09 -08:00
soft-wrap.enable = true;
2024-03-29 12:51:49 -07:00
smart-tab.supersede-menu = false;
2024-01-30 10:46:26 -08:00
};
2024-04-17 00:49:23 -07:00
keys.insert = {
2024-04-27 13:09:00 -07:00
C-space = "completion";
2024-05-28 20:40:46 -07:00
k = {k = "normal_mode";};
2024-04-17 00:49:23 -07:00
};
2024-02-21 18:15:57 -08:00
keys.normal = {
k = "move_line_down";
j = "move_line_up";
};
keys.select = {
2024-02-27 10:26:58 -08:00
k = "extend_line_down";
j = "extend_line_up";
2024-02-21 18:15:57 -08:00
};
2024-04-17 00:49:23 -07:00
keys.normal.space.w = {
k = "jump_view_down";
j = "jump_view_up";
K = "swap_view_down";
J = "swap_view_up";
};
2025-01-23 17:57:22 -08:00
keys.normal.space.t = {
r = "@mip:reflow<ret>";
};
2024-01-30 10:46:26 -08:00
};
languages = {
2024-09-28 15:55:25 -07:00
use-grammars.only = [
2025-02-18 00:47:26 -08:00
"bash"
2024-09-28 15:55:25 -07:00
"c"
"cpp"
2025-02-18 00:47:26 -08:00
"gas"
2024-09-28 15:55:25 -07:00
"html"
"just"
2025-02-18 00:47:26 -08:00
"markdown"
"nix"
"rust"
2025-01-30 17:42:24 -08:00
"scheme"
2025-02-18 00:47:26 -08:00
"sql"
"toml"
"typst"
2024-09-28 15:55:25 -07:00
];
2024-01-30 10:46:26 -08:00
language = [
2025-02-18 00:47:26 -08:00
{
name = "typst";
2025-02-20 23:15:58 -08:00
text-width = 100;
2025-02-18 00:47:26 -08:00
}
2024-09-28 15:55:25 -07:00
{
name = "sql";
language-servers = ["sqls"];
}
2024-10-07 19:41:32 -07:00
{
name = "go";
formatter.command = "goimports";
}
2024-04-12 14:46:13 -07:00
{
name = "arduino";
2024-04-29 13:53:43 -07:00
grammar = "arduino";
2024-04-12 14:46:13 -07:00
scope = "source.arduino";
injection-regex = "arduino";
file-types = ["ino" "cpp" "h"];
comment-token = "//";
roots = ["*.ino" "sketch.yaml"];
language-servers = ["arduino-language-server"];
indent = {
tab-width = 8;
unit = "\t";
};
auto-format = true;
2024-04-28 10:56:51 -07:00
formatter = {
command = "clang-format";
2024-04-29 13:53:43 -07:00
args = ["--style=file:/home/tao/templates/clang-format"];
2024-04-28 10:56:51 -07:00
};
2024-04-12 14:46:13 -07:00
}
2024-01-30 10:46:26 -08:00
{
name = "c";
auto-format = true;
formatter = {
command = "clang-format";
2024-04-29 13:53:43 -07:00
args = ["--style=file:/home/tao/templates/clang-format"];
2024-02-24 02:30:17 -08:00
};
indent = {
tab-width = 8;
unit = "\t";
2024-01-30 10:46:26 -08:00
};
}
2024-04-11 08:32:50 -07:00
{
name = "cpp";
auto-format = true;
formatter = {
command = "clang-format";
2024-04-29 13:53:43 -07:00
args = ["--style=file:/home/tao/templates/clang-format"];
2024-04-11 08:32:50 -07:00
};
2024-04-28 10:56:51 -07:00
indent = {
tab-width = 8;
unit = "\t";
};
2024-04-12 14:46:13 -07:00
file-types = [
"cc"
"hh"
"c++"
"cpp"
"hpp"
"h"
"ipp"
"tpp"
"cxx"
"hxx"
"ixx"
"txx"
"C"
"H"
"cu"
"cuh"
"cppm"
"h++"
"ii"
"inl"
{glob = ".hpp.in";}
{glob = ".h.in";}
];
2024-04-11 08:32:50 -07:00
}
2024-02-24 02:30:17 -08:00
{
name = "html";
auto-format = false;
indent = {
tab-width = 4;
unit = "\t";
};
}
2024-09-21 17:31:00 -07:00
# {
# name = "java";
# auto-format = true;
# indent = {
# tab-width = 4;
# unit = "\t";
# };
# }
2024-03-03 23:17:20 -08:00
{
name = "javascript";
auto-format = true;
indent = {
tab-width = 4;
unit = "\t";
};
}
2024-02-24 02:30:17 -08:00
{
name = "nix";
auto-format = true;
formatter = {command = "alejandra";};
}
2024-05-11 03:41:12 -07:00
{
name = "toml";
auto-format = true;
}
2025-01-30 17:42:24 -08:00
{
name = "typst";
language-servers = ["tinymist"];
}
{
name = "scheme";
language-servers = ["steel"];
}
2024-01-30 10:46:26 -08:00
];
2024-02-19 22:41:58 -08:00
language-servers = {
rust-analyzer.config = {
procMacro = {
ignored = {
leptos_macro = [
# Optional:
# "component",
"server"
];
};
};
};
};
2024-02-26 23:22:48 -08:00
language-server = {
2024-10-07 19:41:32 -07:00
rust-analyzer.config.check.command = "clippy";
2024-09-21 17:31:00 -07:00
# gas = {
# command = "asm-lsp";
# };
# jdtls = {
# command = "jdtls";
# args = ["-data" "/home/tao/.cache/jdtls/workspace"];
# };
2024-04-12 14:46:13 -07:00
arduino-language-server = {
2024-04-28 10:56:51 -07:00
command = "boxxy";
args = ["arduino-language-server" "-cli" "arduino-cli" "-cli-config" "~/.local/share/arduino/cli/arduino-cli.yaml" "-jobs" "0"];
2024-04-12 14:46:13 -07:00
};
2024-10-07 19:41:32 -07:00
# gopls = {
# config = {
# unusedVariable = false;
# };
# };
2024-09-28 15:55:25 -07:00
sqls = {
command = "sqls";
};
2025-01-30 17:42:24 -08:00
tinymist = {
command = "tinymist";
};
steel-language-server = {
command = "steel-language-server";
};
2024-02-26 23:22:48 -08:00
};
2024-02-01 19:24:36 -08:00
grammar = [
2024-04-12 14:46:13 -07:00
{
name = "arduino";
source = {
2024-04-28 10:56:51 -07:00
git = "https://github.com/tree-sitter-grammars/tree-sitter-arduino";
rev = "8518c3fa6b8562af545a496d55c9abd78f53e732";
2024-04-12 14:46:13 -07:00
};
}
2024-02-01 19:24:36 -08:00
];
2024-01-30 10:46:26 -08:00
};
2024-01-30 11:08:42 -08:00
enable = true;
defaultEditor = true;
2025-03-02 16:34:53 -08:00
# package = inputs.helix.packages.${pkgs.system}.default;
2024-01-30 10:46:26 -08:00
};
}