refactor works on lio host

This commit is contained in:
RingOfStorms (Joshua Bell) 2025-03-18 11:53:54 -05:00
parent 1d9c4beaf3
commit f0c096edec
73 changed files with 2214 additions and 1091 deletions

View file

@ -0,0 +1,65 @@
# Reset everything then add what we want exactly
unbind-key -a
bind C-Space send-prefix
# Windows
# bind -r p previous-window
# bind -r n next-window
bind -r & kill-window
bind c new-window -a -c "#{pane_current_path}"
bind ',' command-prompt "rename-window %%"
bind "\|" split-window -h -c "#{pane_current_path}"
bind "\\" split-window -v -c "#{pane_current_path}"
bind w choose-tree -Zw
bind 1 select-window -t:1
bind 2 select-window -t:2
bind 3 select-window -t:3
bind 4 select-window -t:4
bind 5 select-window -t:5
bind 6 select-window -t:6
bind 7 select-window -t:7
bind 8 select-window -t:8
bind 9 select-window -t:9
# custom
bind m command-prompt -p "Swap with window index:" "swap-window -t '%%'"
bind -r [ swap-window -t -1 \; previous-window
bind -r ] swap-window -t +1 \; next-window
# Panes
bind ! break-pane
bind -r left select-pane -L
bind -r down select-pane -D
bind -r up select-pane -U
bind -r right select-pane -R
bind x kill-pane
bind -r space resize-pane -Z
bind S select-layout tiled
bind -r h select-pane -L
bind -r j select-pane -D
bind -r k select-pane -U
bind -r l select-pane -R
# Sessions
bind $ command-prompt "rename-session %%"
bind -r ) switch-client -n
bind -r ( switch-client -p
# custom
bind C command-prompt -p "session name:" "new-session -s '%%'"
# Tmux util
bind : command-prompt
bind C-d detach
# ==========
# My options
set-option -g terminal-overrides ',xterm-256color:RGB'
set-option -sa terminal-features ',xterm:LRGB'
set -g detach-on-destroy off
set -g renumber-windows on
set -g status-position top
set -sg escape-time 0
set -g xterm-keys on
set-option -g focus-events on

View file

@ -0,0 +1,76 @@
{ lib, pkgs, ... }:
{
# home manager doesn't give us an option to add tmux extra config at the top so we do it ourselves here.
xdg.configFile."tmux/tmux.conf".text = lib.mkBefore (builtins.readFile ./tmux-reset.conf);
programs.tmux = {
enable = true;
# Revisit this later, permission denied to make anything in `/run` as my user...
secureSocket = false;
# default is B switch to space for easier dual hand use
shortcut = "Space";
prefix = "C-Space";
baseIndex = 1;
mouse = true;
keyMode = "vi";
shell = "${pkgs.zsh}/bin/zsh";
terminal = "screen-256color";
aggressiveResize = true;
sensibleOnTop = false;
plugins = with pkgs.tmuxPlugins; [
{
plugin = catppuccin.overrideAttrs (_: {
src = pkgs.fetchgit {
url = "https://git.joshuabell.xyz/tmux-catppuccin-coal.git";
rev = "d078123cd81c0dbb3f780e8575a9d38fe2023e1b";
sha256 = "sha256-qPY/dovDyut5WoUkZ26F2w3fJVmw4gcC+6l2ugsA65Y=";
};
});
extraConfig = ''
set -g @catppuccin_flavour 'mocha'
set -g @catppuccin_window_left_separator ""
set -g @catppuccin_window_right_separator " "
set -g @catppuccin_window_middle_separator " "
set -g @catppuccin_window_number_position "right"
set -g @catppuccin_window_default_fill "number"
set -g @catppuccin_window_default_text "#W"
set -g @catppuccin_window_current_fill "number"
set -g @catppuccin_window_current_text "#W#{?window_zoomed_flag,(),}"
set -g @catppuccin_status_modules_right "directory application date_time"
set -g @catppuccin_status_modules_left "session"
set -g @catppuccin_status_left_separator " "
set -g @catppuccin_status_right_separator " "
set -g @catppuccin_status_right_separator_inverse "no"
set -g @catppuccin_status_fill "icon"
set -g @catppuccin_status_connect_separator "no"
set -g @catppuccin_directory_text "#{b:pane_current_path}"
set -g @catppuccin_date_time_text "%H:%M"
'';
}
{
plugin = resurrect;
extraConfig = ''
set -g @resurrect-strategy-nvim 'session'
set -g @resurrect-capture-pane-contents 'on'
# Hook to save tmux-resurrect state when a pane is closed
set-hook -g pane-died "run-shell 'tmux-resurrect save'"
'';
}
{
plugin = continuum;
extraConfig = ''
set -g @continuum-restore 'on'
set -g @continuum-save-interval '5' # minutes
'';
}
];
};
home.shellAliases = {
t = "tmux";
tat = "tmux attach-session";
};
}