Merge branch 'main' of codeberg.org:Lillian-Violet/NixOS-Config

This commit is contained in:
Lillian Violet 2024-10-23 12:51:24 +02:00
commit f9471f0bcf
12 changed files with 203 additions and 175 deletions

View file

@ -31,5 +31,10 @@
zsh
bat
btop
broot
lazygit
navi
yazi
];
programs.navi.enable = true;
}

View file

@ -3,13 +3,33 @@
lib,
pkgs,
...
}: {
}: let
yazi =
pkgs.writeText "open_in_helix_from_yazi.zsh"
''
#! ~/.nix-profile/bin/zsh
files=(''${(fqq)"$( yazi --chooser-file=/dev/stdout | cat )"})
zellij action toggle-floating-panes
zellij action write 27 # send escape-key
zellij action write-chars ":open $files"
zellij action write 13 # send enter-key
zellij action toggle-floating-panes
zellij action close-pane
'';
in {
programs.helix = {
enable = true;
defaultEditor = true;
settings = {
# theme = "catppuccin_macchiato"; # Don't need this because the module themes it for us
keys.normal.backspace = {
b = ":sh zellij run -f -n 'build code' -- direnv exec . just build";
r = ":sh zellij run -f -n 'run code' -- direnv exec . just run";
t = ":sh zellij run -f -n 'test code' -- direnv exec . just test";
g = ":sh zellij run -fc -n 'lazygit' -- lazygit";
f = ":sh zellij run --floating -n 'yazi picker' -- zsh ~/.config/helix/open_in_helix_from_yazi.zsh ";
};
editor = {
line-number = "relative";
lsp.display-messages = true;
@ -158,4 +178,11 @@
target = ".config/helix/external-snippets.toml";
};
};
home.file = {
"yazi" = {
source = "${yazi}";
target = ".config/helix/open_in_helix_from_yazi.zsh";
};
};
}

View file

@ -67,10 +67,11 @@
"zsh-navigation-tools"
];
};
# stuff for zoxide & tre
# Extra commands that take more complex forms
initExtra = ''
eval "$(zoxide init --cmd cd zsh)"
tre() { command tre "$@" -e && source "/tmp/tre_aliases_$USER" 2>/dev/null; }
zhx() { command zellij action new-tab --layout $HOME/.config/zellij/layouts/helix.kdl; }
'';
};
}