mirror of
https://github.com/nmasur/dotfiles
synced 2025-07-06 10:50:13 +00:00
zellij tweaks and session switching
This commit is contained in:
@ -30,6 +30,13 @@ in
|
||||
window-decoration = false;
|
||||
macos-non-native-fullscreen = true;
|
||||
fullscreen = true;
|
||||
keybind = [
|
||||
"super+t=unbind" # Pass super-t to underlying tool (e.g. zellij tabs)
|
||||
"super+shift+]=unbind"
|
||||
"super+shift+[=unbind"
|
||||
"ctrl+tab=unbind"
|
||||
"ctrl+shift+tab=unbind"
|
||||
];
|
||||
};
|
||||
themes."gruvbox" = {
|
||||
background = config.theme.colors.base00;
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
@ -14,6 +15,43 @@ in
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
|
||||
home.packages = [ pkgs.zellij-switch ];
|
||||
|
||||
programs.fish = {
|
||||
functions = {
|
||||
zellij-session = {
|
||||
# description = "Open a session in Zellij";
|
||||
body = # fish
|
||||
''
|
||||
zoxide query --interactive | xargs -I {} sh -c 'zellij pipe --plugin file:$(which zellij-switch.wasm) -- "--cwd {} --layout default --session $(basename {})"' \\;
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
xdg.configFile."zellij/layouts/compact-top.kdl".text = # kdl
|
||||
''
|
||||
layout {
|
||||
pane size=1 borderless=true {
|
||||
plugin location="compact-bar"
|
||||
}
|
||||
pane
|
||||
}
|
||||
'';
|
||||
|
||||
xdg.configFile."zellij/layouts/default.kdl".text = # kdl
|
||||
''
|
||||
layout {
|
||||
pane size=1 borderless=true {
|
||||
plugin location="tab-bar"
|
||||
}
|
||||
pane
|
||||
pane size=1 borderless=true {
|
||||
plugin location="status-bar"
|
||||
}
|
||||
}
|
||||
'';
|
||||
|
||||
programs.zellij = {
|
||||
|
||||
enable = true;
|
||||
@ -22,8 +60,11 @@ in
|
||||
enableZshIntegration = true;
|
||||
|
||||
settings = {
|
||||
# default_layout = "compact-top";
|
||||
# Remove border
|
||||
pane_frames = false;
|
||||
# Scrollback
|
||||
scrollback_editor = config.home.sessionVariables.EDITOR;
|
||||
keybinds = {
|
||||
# _props = {
|
||||
# clear-defaults = true;
|
||||
@ -37,6 +78,7 @@ in
|
||||
"Ctrl p"
|
||||
"Ctrl q"
|
||||
"Ctrl s"
|
||||
"Alt i"
|
||||
];
|
||||
};
|
||||
normal = {
|
||||
@ -67,7 +109,7 @@ in
|
||||
};
|
||||
"bind \"Alt k\"" = {
|
||||
SwitchToMode = {
|
||||
_args = [ "search" ];
|
||||
_args = [ "scroll" ];
|
||||
};
|
||||
};
|
||||
"bind \"Alt o\"" = {
|
||||
@ -78,6 +120,41 @@ in
|
||||
"bind \"Alt q\"" = {
|
||||
"Quit" = { };
|
||||
};
|
||||
"bind \"Alt Shift p\"" = {
|
||||
"Run" = {
|
||||
_args = [
|
||||
"${pkgs.fish}/bin/fish"
|
||||
"-c"
|
||||
"zellij-session"
|
||||
];
|
||||
close_on_exit = true;
|
||||
};
|
||||
};
|
||||
"bind \"Super t\"" = {
|
||||
"NewTab" = { };
|
||||
};
|
||||
"bind \"Super Shift ]\"" = {
|
||||
"GoToPreviousTab" = { };
|
||||
};
|
||||
"bind \"Super Shift [\"" = {
|
||||
"GoToNextTab" = { };
|
||||
};
|
||||
"bind \"Ctrl Tab\"" = {
|
||||
"GoToNextTab" = { };
|
||||
};
|
||||
"bind \"Ctrl Shift Tab\"" = {
|
||||
"GoToPreviousTab" = { };
|
||||
};
|
||||
"bind \"Alt Shift i\"" = {
|
||||
"MoveTab" = {
|
||||
_args = [ "Left" ];
|
||||
};
|
||||
};
|
||||
"bind \"Alt Shift o\"" = {
|
||||
"MoveTab" = {
|
||||
_args = [ "Right" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
locked = {
|
||||
"bind \"Alt l\"" = {
|
||||
@ -86,6 +163,11 @@ in
|
||||
};
|
||||
};
|
||||
};
|
||||
session = {
|
||||
unbind = {
|
||||
_args = [ "Alt o" ];
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
theme = "custom";
|
||||
|
Reference in New Issue
Block a user