Files
nixfiles/lyrathorpe/home/shell.nix
T
Emma ThorpeandClaude Opus 4.8 e7e11c17b0 feat(tmux): apply dotfiles tmux config
From emmaisadev/dotfiles (tmux.conf): run a non-login shell
(default-command), drop the stock %/" split keys (the s/v vim splits
already come from reverseSplit), declare foot's terminal-features
(RGB/sync/clipboard/title/ccolour/cstyle), and raise the scrollback to
500000. Alt-arrow pane nav and mouse were already present. Also drop a
stale comment referencing the removed tty1 autostart.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-09 20:49:36 +01:00

81 lines
2.3 KiB
Nix

# Interactive shell: zsh + tmux. Wanted on every host.
{ lib, ... }:
{
programs.zsh = {
enable = true;
enableCompletion = true;
enableVteIntegration = true;
autosuggestion.enable = true;
# Bind Up/Down for history-substring-search in BOTH cursor-key modes: CSI
# (^[[A/^[[B -- normal mode, and what the Linux TTY sends) and SS3
# (^[OA/^[OB -- application mode, used by foot, tmux and iTerm2). Binding
# only the default CSI form leaves it dead at the prompt in foot/iTerm2.
historySubstringSearch = {
enable = true;
searchUpKey = [
"^[[A"
"^[OA"
];
searchDownKey = [
"^[[B"
"^[OB"
];
};
history.append = true;
oh-my-zsh = {
enable = true;
plugins = [
"git"
"man"
];
theme = "robbyrussell";
};
syntaxHighlighting.enable = true;
# Prefix the prompt with the hostname over SSH.
initContent = lib.mkOrder 1500 ''
if [ "$SSH_CLIENT" ] || [ "$SSH_TTY" ]; then
export PS1="%M $PS1"
fi
'';
envExtra = ''
alias cls=clear
'';
};
programs.tmux = {
enable = true;
reverseSplit = true;
terminal = "tmux-direct";
newSession = true;
keyMode = "vi";
historyLimit = 500000;
mouse = true;
# `reverseSplit = true` already binds s -> vertical and v -> horizontal
# split (the dotfiles' vim-style splits).
extraConfig = ''
# Run a non-login shell in new panes/windows.
set -g default-command "''${SHELL}"
# Drop the stock split keys in favour of the s/v binds above.
unbind %
unbind '"'
# Alt+Arrow pane navigation
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# Tell tmux which capabilities the foot terminal supports, so truecolor,
# synchronised output, the system clipboard (OSC 52), window titles and
# cursor styling all pass through.
set -as terminal-features ",foot*:RGB"
set -as terminal-features ",foot*:sync"
set -as terminal-features ",foot*:clipboard"
set -as terminal-features ",foot*:title"
set -as terminal-features ",foot*:ccolour"
set -as terminal-features ",foot*:cstyle"
'';
};
}