hx-zellij

This commit is contained in:
elwrcl committed 2026-08-19 13:21:21 +03:00
1 parent 184e3e97a4
commit a430d19d44
14 files changed
+1139 -3

No files matched your search

@@ -0,0 +1,54 @@
{ ... }:
{
flake.homeModules.home-helix-keys =
{ ... }:
let
float = cmd: ":sh zellij run --floating --close-on-exit -- ${cmd}";
floatKeep = cmd: ":sh zellij run --floating -- ${cmd}";
in
{
programs.helix.settings.keys = {
normal = {
esc = [
"collapse_selection"
"keep_primary_selection"
];
space = {
q = ":buffer-close";
Q = ":quit";
t = float "nu";
e = float "yazi";
n = ":sh zellij action new-tab";
z = ":sh zellij action toggle-floating-panes";
v = {
v = float "lazyjj";
g = float "lazygit";
s = floatKeep "jj status";
l = floatKeep "jj log";
d = floatKeep "jj diff %{buffer_name}";
D = floatKeep "jj diff";
b = floatKeep "jj file annotate %{buffer_name}";
e = float "jj describe";
c = float "jj commit";
r = ":reset-diff-change";
n = "goto_next_change";
p = "goto_prev_change";
};
u = {
w = ":toggle soft-wrap.enable";
i = ":toggle lsp.display-inlay-hints";
n = ":toggle line-number relative absolute";
d = ":toggle inline-diagnostics.cursor-line hint disable";
h = ":toggle whitespace.render all none";
g = ":toggle indent-guides.render";
c = ":toggle cursorline";
f = ":toggle auto-format";
};
};
};
};
};
}
@@ -0,0 +1,58 @@
{ ... }:
{
flake.homeModules.home-helix-language-servers =
{ pkgs, ... }:
{
programs.helix.extraPackages = with pkgs; [
# nix
nixd
nil
nixfmt
# rust
rust-analyzer
rustfmt
# python
pyright
ruff
# go
gopls
gotools
# zig / haskell / java
zls
zig
haskell-language-server
jdt-language-server
# web
typescript-language-server
typescript
biome
vscode-langservers-extracted
prettier
# lua
lua-language-server
stylua
# c/c++
clang-tools
# shell
bash-language-server
shfmt
taplo
yaml-language-server
# markdown
marksman
# `editor.shell` path
nushell
wl-clipboard
];
};
}
@@ -0,0 +1,302 @@
{ ... }:
{
flake.homeModules.home-helix-languages =
{ config, ... }:
let
flakeRoot = "${config.home.homeDirectory}/copland";
in
{
programs.helix.languages = {
language-server = {
nixd.config.nixd = {
formatting.command = [ "nixfmt" ];
nixpkgs.expr = ''import (builtins.getFlake "${flakeRoot}").inputs.nixpkgs { }'';
options = {
nixos.expr = ''(builtins.getFlake "${flakeRoot}").nixosConfigurations.copland.options'';
home-manager.expr = ''(builtins.getFlake "${flakeRoot}").nixosConfigurations.copland.options.home-manager.users.type.getSubOptions [ ]'';
};
};
# fallback
nil.config.nil.formatting.command = [ "nixfmt" ];
rust-analyzer.config = {
check.command = "clippy";
cargo.buildScripts.enable = true;
procMacro.enable = true;
inlayHints = {
bindingModeHints.enable = true;
closingBraceHints.minLines = 10;
closureReturnTypeHints.enable = "with_block";
discriminantHints.enable = "fieldless";
lifetimeElisionHints.enable = "skip_trivial";
typeHints.hideClosureInitialization = false;
};
};
gopls.config = {
staticcheck = true;
gofumpt = true;
hints = {
assignVariableTypes = true;
compositeLiteralFields = true;
constantValues = true;
functionTypeParameters = true;
parameterNames = true;
rangeVariableTypes = true;
};
};
pyright.config.python.analysis = {
typeCheckingMode = "basic";
autoImportCompletions = true;
};
typescript-language-server.config.typescript.inlayHints = {
includeInlayEnumMemberValueHints = true;
includeInlayFunctionLikeReturnTypeHints = true;
includeInlayFunctionParameterTypeHints = true;
includeInlayParameterNameHints = "all";
includeInlayPropertyDeclarationTypeHints = true;
includeInlayVariableTypeHints = true;
};
biome = {
command = "biome";
args = [ "lsp-proxy" ];
};
yaml-language-server.config.yaml = {
format.enable = true;
validate = true;
schemas = {
"https://json.schemastore.org/github-workflow.json" = ".github/workflows/*.{yml,yaml}";
"https://json.schemastore.org/github-action.json" = "action.{yml,yaml}";
"https://json.schemastore.org/docker-compose.json" = "docker-compose*.{yml,yaml}";
};
};
lua-language-server.config.Lua = {
hint.enable = true;
telemetry.enable = false;
};
};
language = [
{
name = "nix";
language-servers = [
"nixd"
"nil"
];
auto-format = true;
formatter.command = "nixfmt";
}
{
name = "rust";
auto-format = true;
}
{
name = "python";
language-servers = [
"ruff"
"pyright"
];
auto-format = true;
formatter = {
command = "ruff";
args = [
"format"
"-"
];
};
}
{
name = "go";
language-servers = [ "gopls" ];
auto-format = true;
}
{
name = "zig";
auto-format = true;
formatter = {
command = "zig";
args = [
"fmt"
"--stdin"
];
};
}
{
name = "haskell";
auto-format = true;
}
{
name = "java";
language-servers = [ "jdtls" ];
auto-format = true;
}
{
name = "c";
auto-format = true;
}
{
name = "cpp";
auto-format = true;
}
{
name = "lua";
auto-format = true;
formatter = {
command = "stylua";
args = [ "-" ];
};
}
{
name = "bash";
auto-format = true;
formatter = {
command = "shfmt";
args = [
"-i"
"2"
"-ci"
"-s"
"-"
];
};
}
{
name = "typescript";
language-servers = [
"typescript-language-server"
"biome"
];
auto-format = true;
formatter = {
command = "biome";
args = [
"format"
"--stdin-file-path"
"f.ts"
];
};
}
{
name = "tsx";
language-servers = [
"typescript-language-server"
"biome"
];
auto-format = true;
formatter = {
command = "biome";
args = [
"format"
"--stdin-file-path"
"f.tsx"
];
};
}
{
name = "javascript";
language-servers = [
"typescript-language-server"
"biome"
];
auto-format = true;
formatter = {
command = "biome";
args = [
"format"
"--stdin-file-path"
"f.js"
];
};
}
{
name = "jsx";
language-servers = [
"typescript-language-server"
"biome"
];
auto-format = true;
formatter = {
command = "biome";
args = [
"format"
"--stdin-file-path"
"f.jsx"
];
};
}
{
name = "json";
auto-format = true;
formatter = {
command = "biome";
args = [
"format"
"--stdin-file-path"
"f.json"
];
};
}
{
name = "toml";
language-servers = [ "taplo" ];
auto-format = true;
formatter = {
command = "taplo";
args = [
"fmt"
"-"
];
};
}
{
name = "yaml";
language-servers = [ "yaml-language-server" ];
auto-format = true;
formatter = {
command = "prettier";
args = [
"--parser"
"yaml"
];
};
}
{
name = "markdown";
language-servers = [ "marksman" ];
auto-format = true;
formatter = {
command = "prettier";
args = [
"--parser"
"markdown"
];
};
soft-wrap = {
enable = true;
wrap-at-text-width = true;
};
}
{
# Written every time `jj describe`/`jj commit` opens $EDITOR.
name = "jjdescription";
rulers = [
51
73
];
text-width = 72;
auto-format = false;
}
{
name = "git-commit";
auto-format = false;
}
];
};
};
}
+132
View File
@@ -0,0 +1,132 @@
{ ... }:
{
# this could be changed
flake.homeModules.home-helix-theme =
{ ... }:
{
programs.helix.themes.kanagawa-dragon-copnix = {
inherits = "kanagawa-dragon";
palette = {
copBg = "#090E13";
copBgAlt = "#0E141B";
copBgSoft = "#151B22";
copSelect = "#22262D";
copGutter = "#3A414B";
copGray = "#5C6066";
copFg = "#c5c9c7";
copRed = "#c4746e";
copRedBright = "#e46876";
copGreen = "#8a9a7b";
copYellow = "#c4b28a";
copYellowBright = "#e6c384";
copBlue = "#8ba4b0";
copBlueBright = "#7fb4ca";
copMagenta = "#a292a3";
copCyan = "#8ea4a2";
};
"ui.background" = {
fg = "copFg";
bg = "copBg";
};
"ui.text" = "copFg";
"ui.window" = "copBgSoft";
"ui.gutter" = {
bg = "copBg";
};
"ui.linenr" = {
fg = "copGutter";
bg = "copBg";
};
"ui.linenr.selected" = {
fg = "copYellowBright";
bg = "copBg";
modifiers = [ "bold" ];
};
"ui.cursorline.primary" = {
bg = "copBgAlt";
};
"ui.cursorline.secondary" = {
bg = "copBgAlt";
};
"ui.selection" = {
bg = "copSelect";
};
"ui.selection.primary" = {
bg = "#2A3038";
};
"ui.statusline" = {
fg = "copFg";
bg = "copBgSoft";
};
"ui.statusline.inactive" = {
fg = "copGray";
bg = "copBgAlt";
};
"ui.statusline.normal" = {
fg = "copBg";
bg = "copBlueBright";
modifiers = [ "bold" ];
};
"ui.statusline.insert" = {
fg = "copBg";
bg = "copGreen";
modifiers = [ "bold" ];
};
"ui.statusline.select" = {
fg = "copBg";
bg = "copMagenta";
modifiers = [ "bold" ];
};
"ui.bufferline" = {
fg = "copGray";
bg = "copBgAlt";
};
"ui.bufferline.active" = {
fg = "copFg";
bg = "copBgSoft";
modifiers = [ "bold" ];
};
"ui.bufferline.background" = {
bg = "copBg";
};
"ui.popup" = {
fg = "copFg";
bg = "copBgSoft";
};
"ui.popup.info" = {
fg = "copFg";
bg = "copBgAlt";
};
"ui.menu" = {
fg = "copFg";
bg = "copBgSoft";
};
"ui.menu.selected" = {
fg = "copBg";
bg = "copBlueBright";
modifiers = [ "bold" ];
};
"ui.help" = {
fg = "copFg";
bg = "copBgSoft";
};
"ui.virtual.indent-guide" = "copGutter";
"ui.virtual.ruler" = {
bg = "copBgAlt";
};
"ui.virtual.whitespace" = "copGutter";
"diff.plus" = "copGreen";
"diff.minus" = "copRedBright";
"diff.delta" = "copBlueBright";
};
};
}
+131
View File
@@ -0,0 +1,131 @@
{ ... }:
{
flake.homeModules.home-helix =
{ ... }:
{
programs.helix = {
enable = true;
defaultEditor = true;
settings = {
theme = "kanagawa-dragon-copnix";
editor = {
line-number = "relative";
cursorline = true;
color-modes = true;
bufferline = "multiple";
scrolloff = 8;
rulers = [
80
100
];
text-width = 80;
true-color = true;
undercurl = true;
popup-border = "all";
shell = [
"nu"
"--no-config-file"
"-c"
];
idle-timeout = 50;
completion-timeout = 5;
completion-trigger-len = 1;
preview-completion-insert = true;
trim-trailing-whitespace = true;
trim-final-newlines = true;
end-of-line-diagnostics = "hint";
statusline = {
left = [
"mode"
"spinner"
"version-control"
"file-name"
"read-only-indicator"
"file-modification-indicator"
];
center = [ ];
right = [
"diagnostics"
"workspace-diagnostics"
"selections"
"register"
"position"
"position-percentage"
"file-type"
];
mode = {
normal = "NORMAL";
insert = "INSERT";
select = "SELECT";
};
};
lsp = {
display-messages = true;
display-progress-messages = true;
display-inlay-hints = true;
auto-signature-help = true;
};
cursor-shape = {
normal = "block";
insert = "bar";
select = "underline";
};
indent-guides = {
render = true;
character = "╎";
skip-levels = 1;
};
inline-diagnostics = {
cursor-line = "hint";
other-lines = "error";
};
soft-wrap = {
enable = true;
wrap-indicator = "↪ ";
};
auto-save = {
focus-lost = true;
after-delay = {
enable = false;
timeout = 3000;
};
};
file-picker = {
hidden = false;
git-ignore = true;
};
whitespace.characters = {
nbsp = "⍽";
tab = "→";
tabpad = "·";
};
};
};
ignores = [
"!.gitignore"
"!.envrc"
".direnv/"
".jj/"
"result"
"result-*"
"target/"
"node_modules/"
];
};
};
}