mirror of
https://github.com/elwrcl/copnix.git
synced 2026-10-31 06:18:03 +03:00
hx
This commit is contained in:
8 files changed
+167
-62
No files matched your search
@@ -41,13 +41,13 @@ in
|
|||||||
config.flake.homeModules.home-nushell-greeting
|
config.flake.homeModules.home-nushell-greeting
|
||||||
config.flake.homeModules.home-helix
|
config.flake.homeModules.home-helix
|
||||||
config.flake.homeModules.home-helix-keys
|
config.flake.homeModules.home-helix-keys
|
||||||
|
config.flake.homeModules.home-helix-sidebar
|
||||||
config.flake.homeModules.home-helix-languages
|
config.flake.homeModules.home-helix-languages
|
||||||
config.flake.homeModules.home-helix-language-servers
|
config.flake.homeModules.home-helix-language-servers
|
||||||
config.flake.homeModules.home-zellij
|
config.flake.homeModules.home-zellij
|
||||||
config.flake.homeModules.home-zellij-keybinds
|
config.flake.homeModules.home-zellij-keybinds
|
||||||
config.flake.homeModules.home-zellij-layout-ide
|
config.flake.homeModules.home-zellij-layout-ide
|
||||||
config.flake.homeModules.home-zellij-ide-command
|
config.flake.homeModules.home-zellij-ide-command
|
||||||
# theme: one palette, one module per app it feeds
|
|
||||||
config.flake.homeModules.home-theme
|
config.flake.homeModules.home-theme
|
||||||
config.flake.homeModules.home-theme-kemuri
|
config.flake.homeModules.home-theme-kemuri
|
||||||
config.flake.homeModules.home-theme-gtk
|
config.flake.homeModules.home-theme-gtk
|
||||||
|
|||||||
@@ -1,35 +1,12 @@
|
|||||||
{ ... }:
|
{ ... }:
|
||||||
{
|
{
|
||||||
flake.homeModules.home-helix-keys =
|
flake.homeModules.home-helix-keys =
|
||||||
{ config, pkgs, ... }:
|
{ ... }:
|
||||||
let
|
let
|
||||||
float = cmd: ":sh zellij run --floating --close-on-exit -- ${cmd}";
|
float = cmd: ":sh zellij run --floating --close-on-exit -- ${cmd}";
|
||||||
floatKeep = cmd: ":sh zellij run --floating -- ${cmd}";
|
floatKeep = cmd: ":sh zellij run --floating -- ${cmd}";
|
||||||
pick = pkgs.writeShellApplication {
|
|
||||||
name = "hx-pick";
|
|
||||||
runtimeInputs = [
|
|
||||||
pkgs.yazi
|
|
||||||
config.programs.zellij.finalPackage
|
|
||||||
pkgs.coreutils
|
|
||||||
];
|
|
||||||
text = ''
|
|
||||||
chooser=$(mktemp -t hx-pick.XXXXXX)
|
|
||||||
trap 'rm -f "$chooser"' EXIT
|
|
||||||
|
|
||||||
yazi "''${1:-.}" --chooser-file="$chooser"
|
|
||||||
|
|
||||||
picked=$(head -n 1 "$chooser")
|
|
||||||
[ -n "$picked" ] || exit 0
|
|
||||||
|
|
||||||
zellij action toggle-floating-panes
|
|
||||||
zellij action write-chars ":open '$picked'"
|
|
||||||
zellij action write 13
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
home.packages = [ pick ];
|
|
||||||
|
|
||||||
programs.helix.settings.keys = {
|
programs.helix.settings.keys = {
|
||||||
normal = {
|
normal = {
|
||||||
esc = [
|
esc = [
|
||||||
@@ -37,14 +14,16 @@
|
|||||||
"keep_primary_selection"
|
"keep_primary_selection"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
"A-s" = ":sh hx-sidebar-toggle";
|
||||||
|
"A-S" = "split_selection_on_newline";
|
||||||
|
|
||||||
|
"C-f" = "search";
|
||||||
|
"C-tab" = "goto_next_buffer";
|
||||||
|
"C-S-tab" = "goto_previous_buffer";
|
||||||
|
|
||||||
space = {
|
space = {
|
||||||
q = ":buffer-close";
|
q = ":buffer-close";
|
||||||
Q = ":quit";
|
Q = ":quit";
|
||||||
t = float "nu";
|
|
||||||
e = float "hx-pick";
|
|
||||||
E = float "hx-pick %{buffer_name}";
|
|
||||||
n = ":sh zellij action new-tab";
|
|
||||||
z = ":sh zellij action toggle-floating-panes";
|
|
||||||
|
|
||||||
v = {
|
v = {
|
||||||
v = float "lazyjj";
|
v = float "lazyjj";
|
||||||
@@ -72,7 +51,6 @@
|
|||||||
f = ":toggle auto-format";
|
f = ":toggle auto-format";
|
||||||
};
|
};
|
||||||
|
|
||||||
# language server
|
|
||||||
l = {
|
l = {
|
||||||
r = ":lsp-restart";
|
r = ":lsp-restart";
|
||||||
s = ":lsp-stop";
|
s = ":lsp-stop";
|
||||||
@@ -82,6 +60,11 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
insert."C-f" = [
|
||||||
|
"normal_mode"
|
||||||
|
"search"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
flake.homeModules.home-helix-sidebar =
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
let
|
||||||
|
sidebarConfig = pkgs.writeTextDir "yazi.toml" ''
|
||||||
|
[mgr]
|
||||||
|
ratio = [ 0, 1, 0 ]
|
||||||
|
show_hidden = false
|
||||||
|
show_symlink = false
|
||||||
|
linemode = "none"
|
||||||
|
scrolloff = 4
|
||||||
|
'';
|
||||||
|
|
||||||
|
sidebar = pkgs.writeShellApplication {
|
||||||
|
name = "hx-sidebar";
|
||||||
|
runtimeInputs = [
|
||||||
|
pkgs.yazi
|
||||||
|
config.programs.zellij.finalPackage
|
||||||
|
pkgs.coreutils
|
||||||
|
];
|
||||||
|
text = ''
|
||||||
|
cd "''${1:-.}"
|
||||||
|
|
||||||
|
export YAZI_CONFIG_HOME=${sidebarConfig}
|
||||||
|
|
||||||
|
marker="''${XDG_RUNTIME_DIR:-/tmp}/hx-sidebar.''${ZELLIJ_SESSION_NAME:-none}"
|
||||||
|
chooser=$(mktemp -t hx-sidebar.XXXXXX)
|
||||||
|
trap 'rm -f "$chooser" "$marker"' EXIT
|
||||||
|
echo $$ > "$marker"
|
||||||
|
|
||||||
|
while true; do
|
||||||
|
: > "$chooser"
|
||||||
|
yazi . --chooser-file="$chooser"
|
||||||
|
|
||||||
|
picked=$(head -n 1 "$chooser")
|
||||||
|
[ -n "$picked" ] || break
|
||||||
|
|
||||||
|
zellij action move-focus right
|
||||||
|
zellij action write 27
|
||||||
|
zellij action write-chars ":open '$picked'"
|
||||||
|
zellij action write 13
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
toggle = pkgs.writeShellApplication {
|
||||||
|
name = "hx-sidebar-toggle";
|
||||||
|
runtimeInputs = [
|
||||||
|
config.programs.zellij.finalPackage
|
||||||
|
pkgs.coreutils
|
||||||
|
];
|
||||||
|
text = ''
|
||||||
|
if [ -z "''${ZELLIJ_SESSION_NAME:-}" ]; then
|
||||||
|
echo "hx-sidebar-toggle: not inside a zellij session" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
marker="''${XDG_RUNTIME_DIR:-/tmp}/hx-sidebar.''${ZELLIJ_SESSION_NAME}"
|
||||||
|
|
||||||
|
if [ -e "$marker" ] && kill -0 "$(cat "$marker")" 2>/dev/null; then
|
||||||
|
zellij action toggle-fullscreen
|
||||||
|
else
|
||||||
|
rm -f "$marker"
|
||||||
|
|
||||||
|
id=$(zellij action new-pane \
|
||||||
|
--direction right \
|
||||||
|
--name files \
|
||||||
|
--close-on-exit \
|
||||||
|
-- ${sidebar}/bin/hx-sidebar "$PWD")
|
||||||
|
|
||||||
|
zellij action move-pane --pane-id "$id" left
|
||||||
|
for _ in 1 2 3 4 5; do
|
||||||
|
zellij action resize --pane-id "$id" decrease right
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
home.packages = [
|
||||||
|
sidebar
|
||||||
|
toggle
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -7,31 +7,32 @@
|
|||||||
|
|
||||||
linuxKeybinds = [
|
linuxKeybinds = [
|
||||||
"alt+r=reload_config"
|
"alt+r=reload_config"
|
||||||
"alt+q=close_surface"
|
|
||||||
|
|
||||||
"ctrl+space=new_tab"
|
"ctrl+shift+q=close_surface"
|
||||||
"ctrl+page_down=next_tab"
|
|
||||||
"ctrl+page_up=previous_tab"
|
|
||||||
"alt+comma=move_tab:-1"
|
|
||||||
"alt+period=move_tab:1"
|
|
||||||
|
|
||||||
"alt+1=goto_tab:1"
|
"ctrl+shift+t=new_tab"
|
||||||
"alt+2=goto_tab:2"
|
"ctrl+shift+page_down=next_tab"
|
||||||
"alt+3=goto_tab:3"
|
"ctrl+shift+page_up=previous_tab"
|
||||||
"alt+4=goto_tab:4"
|
"ctrl+shift+comma=move_tab:-1"
|
||||||
"alt+5=goto_tab:5"
|
"ctrl+shift+period=move_tab:1"
|
||||||
"alt+6=goto_tab:6"
|
|
||||||
"alt+7=goto_tab:7"
|
"ctrl+shift+1=goto_tab:1"
|
||||||
"alt+8=goto_tab:8"
|
"ctrl+shift+2=goto_tab:2"
|
||||||
"alt+9=goto_tab:9"
|
"ctrl+shift+3=goto_tab:3"
|
||||||
|
"ctrl+shift+4=goto_tab:4"
|
||||||
|
"ctrl+shift+5=goto_tab:5"
|
||||||
|
"ctrl+shift+6=goto_tab:6"
|
||||||
|
"ctrl+shift+7=goto_tab:7"
|
||||||
|
"ctrl+shift+8=goto_tab:8"
|
||||||
|
"ctrl+shift+9=goto_tab:9"
|
||||||
|
|
||||||
"ctrl+shift+backslash=new_split:right"
|
"ctrl+shift+backslash=new_split:right"
|
||||||
"ctrl+shift+minus=new_split:down"
|
"ctrl+shift+minus=new_split:down"
|
||||||
|
|
||||||
"alt+h=goto_split:left"
|
"ctrl+shift+h=goto_split:left"
|
||||||
"alt+j=goto_split:bottom"
|
"ctrl+shift+j=goto_split:bottom"
|
||||||
"alt+k=goto_split:top"
|
"ctrl+shift+k=goto_split:top"
|
||||||
"alt+l=goto_split:right"
|
"ctrl+shift+l=goto_split:right"
|
||||||
|
|
||||||
"ctrl+shift+z=toggle_split_zoom"
|
"ctrl+shift+z=toggle_split_zoom"
|
||||||
"ctrl+shift+e=equalize_splits"
|
"ctrl+shift+e=equalize_splits"
|
||||||
@@ -76,7 +77,7 @@
|
|||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
font-family = "JetBrainsMono Nerd Font";
|
font-family = "JetBrainsMono Nerd Font";
|
||||||
font-size = 11;
|
font-size = 12;
|
||||||
|
|
||||||
window-padding-x = 10;
|
window-padding-x = 10;
|
||||||
window-padding-y = 10;
|
window-padding-y = 10;
|
||||||
@@ -87,7 +88,6 @@
|
|||||||
mouse-scroll-multiplier = 2;
|
mouse-scroll-multiplier = 2;
|
||||||
shell-integration-features = "no-cursor,sudo,no-title";
|
shell-integration-features = "no-cursor,sudo,no-title";
|
||||||
|
|
||||||
# Colors live in home-theme-ghostty, driven by the active palette.
|
|
||||||
cursor-style = "block";
|
cursor-style = "block";
|
||||||
cursor-style-blink = true;
|
cursor-style-blink = true;
|
||||||
adjust-cell-height = "35%";
|
adjust-cell-height = "35%";
|
||||||
|
|||||||
@@ -24,20 +24,23 @@
|
|||||||
"disk"
|
"disk"
|
||||||
"colors"
|
"colors"
|
||||||
];
|
];
|
||||||
labelColor = "magenta";
|
labelColor = "white";
|
||||||
separator = "-";
|
separator = "-";
|
||||||
box = false;
|
box = true;
|
||||||
shading = null;
|
shading = null;
|
||||||
shadingMode = "sextants";
|
shadingMode = "sextants";
|
||||||
logoOuter = null;
|
logoOuter = null;
|
||||||
logoInner = null;
|
logoInner = null;
|
||||||
light = "top-left";
|
light = "top";
|
||||||
spin = "xy";
|
spin = "y";
|
||||||
speed = null;
|
speed = null;
|
||||||
size = null;
|
size = null;
|
||||||
height = null;
|
height = null;
|
||||||
depth = null;
|
depth = null;
|
||||||
disks = [ ];
|
disks = [
|
||||||
|
"/mnt/HDD/linuxdata"
|
||||||
|
"/mnt/HDD/shared"
|
||||||
|
];
|
||||||
logo = null;
|
logo = null;
|
||||||
logoDistro = null;
|
logoDistro = null;
|
||||||
extraConfig = "";
|
extraConfig = "";
|
||||||
|
|||||||
@@ -110,11 +110,10 @@
|
|||||||
_ if ($name | str ends-with ".zip") => { ^unzip $file }
|
_ if ($name | str ends-with ".zip") => { ^unzip $file }
|
||||||
_ if ($name | str ends-with ".7z") => { ^7z x $file }
|
_ if ($name | str ends-with ".7z") => { ^7z x $file }
|
||||||
_ if ($name | str ends-with ".rar") => { ^unrar e $file }
|
_ if ($name | str ends-with ".rar") => { ^unrar e $file }
|
||||||
_ => { print $"(ansi red)'($name)' açılamıyor(ansi reset)" }
|
_ => { print $"(ansi red)'($name)' cannot be extracted(ansi reset)" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# `which`, with canonicalize .
|
|
||||||
def realwhich [...applications: string, --all (-a)] {
|
def realwhich [...applications: string, --all (-a)] {
|
||||||
which --all=$all ...$applications
|
which --all=$all ...$applications
|
||||||
| update path {|row|
|
| update path {|row|
|
||||||
|
|||||||
@@ -7,6 +7,28 @@
|
|||||||
keybinds clear-defaults=true {
|
keybinds clear-defaults=true {
|
||||||
normal {
|
normal {
|
||||||
bind "Ctrl g" { SwitchToMode "Tmux"; }
|
bind "Ctrl g" { SwitchToMode "Tmux"; }
|
||||||
|
|
||||||
|
// workbench, no prefix: Alt is zellij's layer
|
||||||
|
bind "Alt Space" { ToggleFloatingPanes; }
|
||||||
|
bind "Alt g" {
|
||||||
|
Run "lazyjj" {
|
||||||
|
floating true
|
||||||
|
close_on_exit true
|
||||||
|
name "source control"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// tabs
|
||||||
|
bind "Alt t" { NewTab; }
|
||||||
|
bind "Alt 1" { GoToTab 1; }
|
||||||
|
bind "Alt 2" { GoToTab 2; }
|
||||||
|
bind "Alt 3" { GoToTab 3; }
|
||||||
|
bind "Alt 4" { GoToTab 4; }
|
||||||
|
bind "Alt 5" { GoToTab 5; }
|
||||||
|
bind "Alt 6" { GoToTab 6; }
|
||||||
|
bind "Alt 7" { GoToTab 7; }
|
||||||
|
bind "Alt 8" { GoToTab 8; }
|
||||||
|
bind "Alt 9" { GoToTab 9; }
|
||||||
}
|
}
|
||||||
|
|
||||||
locked {
|
locked {
|
||||||
@@ -62,7 +84,7 @@
|
|||||||
bind "[" { SwitchToMode "Scroll"; }
|
bind "[" { SwitchToMode "Scroll"; }
|
||||||
bind "/" { SwitchToMode "EnterSearch"; SearchInput 0; }
|
bind "/" { SwitchToMode "EnterSearch"; SearchInput 0; }
|
||||||
|
|
||||||
// tools, as floating panes over the editor
|
// tools
|
||||||
bind "g" {
|
bind "g" {
|
||||||
Run "lazyjj" {
|
Run "lazyjj" {
|
||||||
floating true
|
floating true
|
||||||
|
|||||||
@@ -13,8 +13,20 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
tab name="edit" focus=true {
|
tab name="edit" focus=true {
|
||||||
pane command="hx" close_on_exit=true {
|
pane split_direction="vertical" {
|
||||||
args "."
|
pane size="20%" name="files" command="hx-sidebar" close_on_exit=true {
|
||||||
|
args "."
|
||||||
|
}
|
||||||
|
pane focus=true command="hx" close_on_exit=true
|
||||||
|
}
|
||||||
|
|
||||||
|
floating_panes {
|
||||||
|
pane name="terminal" command="nu" {
|
||||||
|
x "5%"
|
||||||
|
y "52%"
|
||||||
|
width "90%"
|
||||||
|
height "44%"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user