mirror of
https://github.com/elwrcl/copnix.git
synced 2026-10-31 14:28:02 +03:00
hx-zellij
This commit is contained in:
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;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -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";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -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/"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
{ ... }:
|
||||
{
|
||||
flake.homeModules.home-nushell-editor =
|
||||
{ ... }:
|
||||
{
|
||||
programs.nushell = {
|
||||
environmentVariables = {
|
||||
EDITOR = "hx";
|
||||
VISUAL = "hx";
|
||||
};
|
||||
|
||||
shellAliases = {
|
||||
e = "hx";
|
||||
cop = "ide ~/copland";
|
||||
};
|
||||
#/nu/#
|
||||
extraConfig = ''
|
||||
def hxf [] {
|
||||
let picked = (
|
||||
do {
|
||||
fd --type f --hidden --exclude .git
|
||||
| fzf --preview 'bat --color=always --style=numbers {}'
|
||||
} | complete
|
||||
)
|
||||
|
||||
if $picked.exit_code != 0 { return }
|
||||
|
||||
let file = ($picked.stdout | str trim)
|
||||
if ($file | is-not-empty) { hx $file }
|
||||
}
|
||||
|
||||
def hxd [rev: string = "@"] {
|
||||
let files = (
|
||||
jj diff --revision $rev --name-only
|
||||
| lines
|
||||
| where { |line| ($line | str trim) != "" }
|
||||
)
|
||||
|
||||
if ($files | is-empty) {
|
||||
print $"(ansi yellow)($rev) no changes (ansi reset)"
|
||||
return
|
||||
}
|
||||
|
||||
hx ...$files
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -7,8 +7,8 @@
|
||||
$env.config.keybindings ++= [
|
||||
{
|
||||
name: jj_status
|
||||
modifier: control
|
||||
keycode: char_g
|
||||
modifier: alt
|
||||
keycode: char_s
|
||||
mode: [ emacs vi_insert vi_normal ]
|
||||
event: { send: executehostcommand, cmd: "jj status" }
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
{ ... }:
|
||||
{
|
||||
flake.homeModules.home-zellij-ide-command =
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
home.packages = [
|
||||
(pkgs.writeShellApplication {
|
||||
name = "ide";
|
||||
runtimeInputs = [
|
||||
config.programs.zellij.finalPackage
|
||||
pkgs.coreutils
|
||||
pkgs.gnugrep
|
||||
];
|
||||
text = ''
|
||||
case "''${1:-}" in
|
||||
-h | --help)
|
||||
echo "usage: ide [directory]"
|
||||
echo
|
||||
echo "opens re-attaches to a Zellij session named after the"
|
||||
echo "directory, running Helix in the 'ide' layout."
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
cd "''${1:-.}"
|
||||
|
||||
session=$(basename "$PWD")
|
||||
session=$(printf '%s' "$session" | tr -c 'A-Za-z0-9._-' '-')
|
||||
|
||||
if zellij list-sessions --short 2>/dev/null | grep -qx "$session"; then
|
||||
exec zellij attach "$session"
|
||||
fi
|
||||
|
||||
exec zellij --session "$session" --new-session-with-layout ide
|
||||
'';
|
||||
})
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,176 @@
|
||||
{ ... }:
|
||||
{
|
||||
flake.homeModules.home-zellij-keybinds =
|
||||
{ ... }:
|
||||
{
|
||||
programs.zellij.extraConfig = ''
|
||||
keybinds clear-defaults=true {
|
||||
normal {
|
||||
bind "Ctrl g" { SwitchToMode "Tmux"; }
|
||||
}
|
||||
|
||||
locked {
|
||||
bind "Ctrl g" { SwitchToMode "Normal"; }
|
||||
}
|
||||
|
||||
tmux {
|
||||
bind "Ctrl g" { Write 7; SwitchToMode "Normal"; }
|
||||
|
||||
// panes
|
||||
bind "-" "\"" { NewPane "Down"; SwitchToMode "Normal"; }
|
||||
bind "\\" "%" { NewPane "Right"; SwitchToMode "Normal"; }
|
||||
bind "n" { NewPane; SwitchToMode "Normal"; }
|
||||
bind "x" { CloseFocus; SwitchToMode "Normal"; }
|
||||
bind "z" { ToggleFocusFullscreen; SwitchToMode "Normal"; }
|
||||
bind "w" { ToggleFloatingPanes; SwitchToMode "Normal"; }
|
||||
bind "e" { TogglePaneEmbedOrFloating; SwitchToMode "Normal"; }
|
||||
bind "i" { TogglePanePinned; SwitchToMode "Normal"; }
|
||||
bind "Space" { NextSwapLayout; SwitchToMode "Normal"; }
|
||||
|
||||
// focus
|
||||
bind "h" "Left" { MoveFocus "Left"; SwitchToMode "Normal"; }
|
||||
bind "j" "Down" { MoveFocus "Down"; SwitchToMode "Normal"; }
|
||||
bind "k" "Up" { MoveFocus "Up"; SwitchToMode "Normal"; }
|
||||
bind "l" "Right" { MoveFocus "Right"; SwitchToMode "Normal"; }
|
||||
bind "o" { FocusNextPane; SwitchToMode "Normal"; }
|
||||
|
||||
// moving panes around
|
||||
bind "H" { MovePane "Left"; SwitchToMode "Normal"; }
|
||||
bind "J" { MovePane "Down"; SwitchToMode "Normal"; }
|
||||
bind "K" { MovePane "Up"; SwitchToMode "Normal"; }
|
||||
bind "L" { MovePane "Right"; SwitchToMode "Normal"; }
|
||||
|
||||
// tabs
|
||||
bind "c" { NewTab; SwitchToMode "Normal"; }
|
||||
bind "," { SwitchToMode "RenameTab"; TabNameInput 0; }
|
||||
bind "X" { CloseTab; SwitchToMode "Normal"; }
|
||||
bind "p" { GoToPreviousTab; SwitchToMode "Normal"; }
|
||||
bind "b" { BreakPane; SwitchToMode "Normal"; }
|
||||
bind "Tab" { ToggleTab; SwitchToMode "Normal"; }
|
||||
bind "1" { GoToTab 1; SwitchToMode "Normal"; }
|
||||
bind "2" { GoToTab 2; SwitchToMode "Normal"; }
|
||||
bind "3" { GoToTab 3; SwitchToMode "Normal"; }
|
||||
bind "4" { GoToTab 4; SwitchToMode "Normal"; }
|
||||
bind "5" { GoToTab 5; SwitchToMode "Normal"; }
|
||||
bind "6" { GoToTab 6; SwitchToMode "Normal"; }
|
||||
bind "7" { GoToTab 7; SwitchToMode "Normal"; }
|
||||
bind "8" { GoToTab 8; SwitchToMode "Normal"; }
|
||||
bind "9" { GoToTab 9; SwitchToMode "Normal"; }
|
||||
|
||||
// sub-modes
|
||||
bind "r" { SwitchToMode "Resize"; }
|
||||
bind "[" { SwitchToMode "Scroll"; }
|
||||
bind "/" { SwitchToMode "EnterSearch"; SearchInput 0; }
|
||||
|
||||
// tools, as floating panes over the editor
|
||||
bind "g" {
|
||||
Run "lazyjj" {
|
||||
floating true
|
||||
close_on_exit true
|
||||
name "lazyjj"
|
||||
}
|
||||
SwitchToMode "Normal"
|
||||
}
|
||||
bind "G" {
|
||||
Run "lazygit" {
|
||||
floating true
|
||||
close_on_exit true
|
||||
name "lazygit"
|
||||
}
|
||||
SwitchToMode "Normal"
|
||||
}
|
||||
bind "t" {
|
||||
Run "nu" {
|
||||
floating true
|
||||
close_on_exit true
|
||||
name "shell"
|
||||
}
|
||||
SwitchToMode "Normal"
|
||||
}
|
||||
bind "y" {
|
||||
Run "yazi" {
|
||||
floating true
|
||||
close_on_exit true
|
||||
name "files"
|
||||
}
|
||||
SwitchToMode "Normal"
|
||||
}
|
||||
bind "f" {
|
||||
LaunchOrFocusPlugin "filepicker" {
|
||||
floating true
|
||||
move_to_focused_tab true
|
||||
}
|
||||
SwitchToMode "Normal"
|
||||
}
|
||||
bind "s" {
|
||||
LaunchOrFocusPlugin "session-manager" {
|
||||
floating true
|
||||
move_to_focused_tab true
|
||||
}
|
||||
SwitchToMode "Normal"
|
||||
}
|
||||
|
||||
// session
|
||||
bind "d" { Detach; }
|
||||
bind "Q" { Quit; }
|
||||
}
|
||||
|
||||
resize {
|
||||
bind "h" "Left" { Resize "Increase Left"; }
|
||||
bind "j" "Down" { Resize "Increase Down"; }
|
||||
bind "k" "Up" { Resize "Increase Up"; }
|
||||
bind "l" "Right" { Resize "Increase Right"; }
|
||||
bind "H" { Resize "Decrease Left"; }
|
||||
bind "J" { Resize "Decrease Down"; }
|
||||
bind "K" { Resize "Decrease Up"; }
|
||||
bind "L" { Resize "Decrease Right"; }
|
||||
bind "=" "+" { Resize "Increase"; }
|
||||
bind "-" { Resize "Decrease"; }
|
||||
}
|
||||
|
||||
scroll {
|
||||
bind "j" "Down" { ScrollDown; }
|
||||
bind "k" "Up" { ScrollUp; }
|
||||
bind "d" { HalfPageScrollDown; }
|
||||
bind "u" { HalfPageScrollUp; }
|
||||
bind "Ctrl f" "PageDown" { PageScrollDown; }
|
||||
bind "Ctrl b" "PageUp" { PageScrollUp; }
|
||||
bind "G" { ScrollToBottom; SwitchToMode "Normal"; }
|
||||
bind "e" { EditScrollback; SwitchToMode "Normal"; }
|
||||
bind "/" { SwitchToMode "EnterSearch"; SearchInput 0; }
|
||||
}
|
||||
|
||||
search {
|
||||
bind "j" "Down" { ScrollDown; }
|
||||
bind "k" "Up" { ScrollUp; }
|
||||
bind "d" { HalfPageScrollDown; }
|
||||
bind "u" { HalfPageScrollUp; }
|
||||
bind "n" { Search "down"; }
|
||||
bind "p" { Search "up"; }
|
||||
bind "c" { SearchToggleOption "CaseSensitivity"; }
|
||||
bind "w" { SearchToggleOption "Wrap"; }
|
||||
bind "o" { SearchToggleOption "WholeWord"; }
|
||||
}
|
||||
|
||||
entersearch {
|
||||
bind "Ctrl c" "Esc" { SwitchToMode "Scroll"; }
|
||||
bind "Enter" { SwitchToMode "Search"; }
|
||||
}
|
||||
|
||||
renametab {
|
||||
bind "Ctrl c" { SwitchToMode "Normal"; }
|
||||
bind "Esc" { UndoRenameTab; SwitchToMode "Normal"; }
|
||||
}
|
||||
|
||||
renamepane {
|
||||
bind "Ctrl c" { SwitchToMode "Normal"; }
|
||||
bind "Esc" { UndoRenamePane; SwitchToMode "Normal"; }
|
||||
}
|
||||
|
||||
shared_except "normal" "locked" "entersearch" "renametab" "renamepane" {
|
||||
bind "Enter" "Esc" { SwitchToMode "Normal"; }
|
||||
}
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{ ... }:
|
||||
{
|
||||
flake.homeModules.home-zellij-layout-ide =
|
||||
{ ... }:
|
||||
{
|
||||
programs.zellij.layouts.ide = ''
|
||||
layout {
|
||||
default_tab_template {
|
||||
pane size=1 borderless=true {
|
||||
plugin location="zellij:compact-bar"
|
||||
}
|
||||
children
|
||||
}
|
||||
|
||||
tab name="edit" focus=true {
|
||||
pane command="hx" close_on_exit=true {
|
||||
args "."
|
||||
}
|
||||
}
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
{ ... }:
|
||||
{
|
||||
flake.homeModules.home-zellij-theme =
|
||||
{ ... }:
|
||||
# this could be change
|
||||
{
|
||||
programs.zellij.themes.kanagawa-dragon-copnix = ''
|
||||
themes {
|
||||
kanagawa-dragon-copnix {
|
||||
text_unselected {
|
||||
base 197 201 199
|
||||
background 9 14 19
|
||||
emphasis_0 182 146 123
|
||||
emphasis_1 127 180 202
|
||||
emphasis_2 138 154 123
|
||||
emphasis_3 162 146 163
|
||||
}
|
||||
text_selected {
|
||||
base 9 14 19
|
||||
background 127 180 202
|
||||
emphasis_0 182 146 123
|
||||
emphasis_1 9 14 19
|
||||
emphasis_2 138 154 123
|
||||
emphasis_3 162 146 163
|
||||
}
|
||||
ribbon_selected {
|
||||
base 9 14 19
|
||||
background 127 180 202
|
||||
emphasis_0 196 116 110
|
||||
emphasis_1 182 146 123
|
||||
emphasis_2 162 146 163
|
||||
emphasis_3 139 164 176
|
||||
}
|
||||
ribbon_unselected {
|
||||
base 197 201 199
|
||||
background 34 38 45
|
||||
emphasis_0 196 116 110
|
||||
emphasis_1 197 201 199
|
||||
emphasis_2 139 164 176
|
||||
emphasis_3 162 146 163
|
||||
}
|
||||
table_title {
|
||||
base 138 154 123
|
||||
background 0
|
||||
emphasis_0 182 146 123
|
||||
emphasis_1 127 180 202
|
||||
emphasis_2 138 154 123
|
||||
emphasis_3 162 146 163
|
||||
}
|
||||
table_cell_selected {
|
||||
base 9 14 19
|
||||
background 127 180 202
|
||||
emphasis_0 182 146 123
|
||||
emphasis_1 9 14 19
|
||||
emphasis_2 138 154 123
|
||||
emphasis_3 162 146 163
|
||||
}
|
||||
table_cell_unselected {
|
||||
base 197 201 199
|
||||
background 9 14 19
|
||||
emphasis_0 182 146 123
|
||||
emphasis_1 127 180 202
|
||||
emphasis_2 138 154 123
|
||||
emphasis_3 162 146 163
|
||||
}
|
||||
list_selected {
|
||||
base 9 14 19
|
||||
background 127 180 202
|
||||
emphasis_0 182 146 123
|
||||
emphasis_1 9 14 19
|
||||
emphasis_2 138 154 123
|
||||
emphasis_3 162 146 163
|
||||
}
|
||||
list_unselected {
|
||||
base 197 201 199
|
||||
background 9 14 19
|
||||
emphasis_0 182 146 123
|
||||
emphasis_1 127 180 202
|
||||
emphasis_2 138 154 123
|
||||
emphasis_3 162 146 163
|
||||
}
|
||||
frame_selected {
|
||||
base 127 180 202
|
||||
background 0
|
||||
emphasis_0 182 146 123
|
||||
emphasis_1 138 154 123
|
||||
emphasis_2 162 146 163
|
||||
emphasis_3 0
|
||||
}
|
||||
frame_highlight {
|
||||
base 182 146 123
|
||||
background 0
|
||||
emphasis_0 162 146 163
|
||||
emphasis_1 182 146 123
|
||||
emphasis_2 182 146 123
|
||||
emphasis_3 182 146 123
|
||||
}
|
||||
exit_code_success {
|
||||
base 138 154 123
|
||||
background 0
|
||||
emphasis_0 127 180 202
|
||||
emphasis_1 9 14 19
|
||||
emphasis_2 162 146 163
|
||||
emphasis_3 139 164 176
|
||||
}
|
||||
exit_code_error {
|
||||
base 228 104 118
|
||||
background 0
|
||||
emphasis_0 230 195 132
|
||||
emphasis_1 0
|
||||
emphasis_2 0
|
||||
emphasis_3 0
|
||||
}
|
||||
multiplayer_user_colors {
|
||||
player_1 162 146 163
|
||||
player_2 139 164 176
|
||||
player_3 0
|
||||
player_4 230 195 132
|
||||
player_5 127 180 202
|
||||
player_6 0
|
||||
player_7 196 116 110
|
||||
player_8 0
|
||||
player_9 0
|
||||
player_10 0
|
||||
}
|
||||
}
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
{ ... }:
|
||||
{
|
||||
flake.homeModules.home-zellij =
|
||||
{ ... }:
|
||||
{
|
||||
programs.zellij = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
theme = "kanagawa-dragon-copnix";
|
||||
default_layout = "compact";
|
||||
default_mode = "normal";
|
||||
default_shell = "nu";
|
||||
pane_frames = false;
|
||||
ui.pane_frames.rounded_corners = true;
|
||||
mouse_mode = true;
|
||||
copy_command = "wl-copy";
|
||||
copy_on_select = true;
|
||||
styled_underlines = true;
|
||||
support_kitty_keyboard_protocol = true;
|
||||
stacked_resize = true;
|
||||
scroll_buffer_size = 50000;
|
||||
scrollback_editor = "hx";
|
||||
session_serialization = true;
|
||||
serialize_pane_viewport = true;
|
||||
on_force_close = "detach";
|
||||
show_startup_tips = false;
|
||||
show_release_notes = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -173,7 +173,6 @@
|
||||
rustfmt
|
||||
lazygit
|
||||
nixfmt
|
||||
zellij
|
||||
sqlite
|
||||
aubio
|
||||
delta
|
||||
|
||||
Reference in new issue
Block a user