tmux: Initial config
This commit is contained in:
@@ -87,7 +87,7 @@ of `dot` itself.
|
||||
`_dot_<name>_usage` should print its text as a single multi-line
|
||||
`echo "..."` string (fish preserves literal newlines inside double
|
||||
quotes) rather than one `echo` per line.
|
||||
4. Add a row to `~/.gitea/README.md`'s command table for it — one row per
|
||||
4. Add a row to `~/.github/README.md`'s command table for it — one row per
|
||||
distinct use case, with paths written relative to `$HOME`
|
||||
(`~/.config/dot/...`), not relative to the README's own location.
|
||||
5. Add a case to `~/.config/dot/tests/dot.fish` covering it, including its
|
||||
@@ -118,3 +118,11 @@ Tests live at `~/.config/dot/tests/dot.fish`, run with
|
||||
- `@test "description" <expr> <op> <expected>` mirrors fish's `test` builtin
|
||||
(`-eq`, `-ne`, `=`, `-e`, `-f`, `-d`, `-n`, `-z`); `-a`/`-o` combinators
|
||||
aren't supported.
|
||||
|
||||
## Keybindings
|
||||
|
||||
Whenever a keybind is added, changed, or removed in *any* config on this
|
||||
machine (tmux, KDE, neovim, fish, whatever), add or update its row in
|
||||
[`~/.github/keybindings.md`](../../.github/keybindings.md) in the same
|
||||
change. That file is the single reference for every keybind across tools —
|
||||
it drifts the moment a bind changes somewhere without a matching edit there.
|
||||
|
||||
3
.config/fish/functions/tmx.fish
Normal file
3
.config/fish/functions/tmx.fish
Normal file
@@ -0,0 +1,3 @@
|
||||
function tmx --description 'Attach to a tmux session, creating it if needed'
|
||||
tmux new-session -A -s $argv[1]
|
||||
end
|
||||
65
.config/tmux/tmux.conf
Normal file
65
.config/tmux/tmux.conf
Normal file
@@ -0,0 +1,65 @@
|
||||
# Prefix: Ctrl-Space. Chosen over Ctrl-b (awkward reach) and Ctrl-a (collides
|
||||
# with readline's beginning-of-line, which fights editing text in shells and
|
||||
# in Claude Code's prompt). Verified clear of IME/KDE/Claude Code bindings.
|
||||
unbind C-b
|
||||
set -g prefix C-Space
|
||||
bind C-Space send-prefix
|
||||
|
||||
set -g mouse on
|
||||
# OSC52 lets copy-mode selections land in the system clipboard via the
|
||||
# terminal itself (Alacritty supports it) -- no wl-copy/xclip needed, and it
|
||||
# still works over SSH later since the escape sequence travels with the data.
|
||||
set -g set-clipboard on
|
||||
|
||||
set -g mode-keys vi
|
||||
set -g status-keys vi
|
||||
bind -T copy-mode-vi v send -X begin-selection
|
||||
bind -T copy-mode-vi y send -X copy-selection-and-cancel
|
||||
bind -T copy-mode-vi MouseDragEnd1Pane send -X copy-selection-and-cancel
|
||||
|
||||
# tmux's -h/-v split flags name the *arrangement*, not the divider line, which
|
||||
# is backwards from how the divider looks -- so pick keys by what they draw:
|
||||
# \ draws a side-by-side split (vertical line), - draws a stacked split
|
||||
# (horizontal line). Unshifted versions of |/- since splitting is frequent.
|
||||
unbind %
|
||||
unbind '"'
|
||||
bind \\ split-window -h -c "#{pane_current_path}"
|
||||
bind - split-window -v -c "#{pane_current_path}"
|
||||
bind c new-window -c "#{pane_current_path}"
|
||||
|
||||
bind h select-pane -L
|
||||
bind j select-pane -D
|
||||
bind k select-pane -U
|
||||
bind l select-pane -R
|
||||
|
||||
set -g base-index 1
|
||||
setw -g pane-base-index 1
|
||||
set -g renumber-windows on
|
||||
|
||||
bind r source-file ~/.config/tmux/tmux.conf \; display-message "tmux.conf reloaded"
|
||||
|
||||
# True color passthrough. ",*" (rather than naming Alacritty's xterm-256color
|
||||
# specifically) so this keeps working if the terminal emulator changes later.
|
||||
set -g default-terminal "tmux-256color"
|
||||
set -ag terminal-overrides ",*:RGB"
|
||||
|
||||
# Default 500ms delay on Esc exists to disambiguate meta-key sequences; it
|
||||
# reads as noticeable lag exiting insert mode in neovim, so drop it.
|
||||
set -sg escape-time 10
|
||||
|
||||
set -g history-limit 10000
|
||||
|
||||
# Minimal status bar (session + window list only), styled to match the Nord
|
||||
# theme already used in alacritty.toml.
|
||||
set -g status-position bottom
|
||||
set -g status-style "bg=#2E3440,fg=#D8DEE9"
|
||||
set -g status-left " #S "
|
||||
set -g status-left-length 20
|
||||
set -g status-right ""
|
||||
setw -g window-status-current-style "bg=#88C0D0,fg=#2E3440,bold"
|
||||
setw -g window-status-current-format " #I:#W "
|
||||
setw -g window-status-format " #I:#W "
|
||||
setw -g window-status-style "fg=#4C566A"
|
||||
|
||||
set -g pane-border-style "fg=#3B4252"
|
||||
set -g pane-active-border-style "fg=#88C0D0"
|
||||
Reference in New Issue
Block a user