Added a config for helide (helix ide), remove default configs for yazi and zellij

This commit is contained in:
Tyler Mayoff 2025-03-07 08:47:12 -05:00
parent 7886e793b8
commit 8f7d6ef23a
4 changed files with 79 additions and 3 deletions

View file

@ -0,0 +1,76 @@
{...}: {
xdg.configFile."helide/yazi.toml" = {
text = ''
[manager]
ratio = [0, 4, 0]
[opener]
edit = [
{ run = '~/.config/helide/,yazi_opener.sh "$1"', desc = "Open File in helix" }
]
'';
};
xdg.configFile."helide/,yazi_opener.sh" = {
text = ''
#!/usr/bin/env bash
# Move focus to the next pane
zellij action focus-next-pane
# Get the running command in the current pane
RUNNING_COMMAND=$(zellij action list-clients | awk 'NR==2 {print $3}')
# Check if the command running in the current pane is helix (hx)
if echo "$RUNNING_COMMAND" | grep -q "hx$"; then
# The current pane is running helix, use zellij actions to open the file
zellij action write 27
zellij action write-chars ":open $1"
zellij action write 13
else
# The current pane is not running helix, so open helix in a new pane
zellij action new-pane
sleep 0.3
zellij action write-chars "hx $1"
zellij action write 13
# warning from before I got it working
# zellij action new-pane --name "WARNING" -- "echo" "please open helix in a pane right next to the sidebar (to the right of it) using 'hx path_to_file'"
fi
'';
executable = true;
};
xdg.configFile."helide/zellij_layout" = {
text = ''
layout {
default_tab_template {
pane size=1 borderless=true {
plugin location="zellij:tab-bar"
}
children
pane size=2 borderless=true {
plugin location="zellij:status-bar"
}
}
tab name="IDE" {
pane split_direction="vertical" {
pane name="sidebar" {
command "env"
args "YAZI_CONFIG_HOME=~/.config/helide" "yazi"
size "20%"
}
pane command="hx"
}
}
tab name="shell"
}
'';
};
home.shellAliases ={
helide = "zellij -l ~/.config/helide/zellij_layout";
};
}

View file

@ -46,7 +46,7 @@
# Nix options
nix.optimise.automatic = true;
nix.settings.experimental-features = ["nix-command" "flakes"];
nix.trustedUsers = ["tyler" "@wheel"];
nix.settings.trusted-users = ["tyler" "@wheel"];
networking.hostName = "wash"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.

View file

@ -10,6 +10,8 @@
../../home/home-backup.nix
../../home/gui.nix
../../home/helide
];
home = {

View file

@ -1,2 +0,0 @@
[manager]
ratio = [0, 4, 0]