refactor(modules): organize module tree
This commit was merged in pull request #72.
This commit is contained in:
43
modules/shell/tmux/extra.conf
Normal file
43
modules/shell/tmux/extra.conf
Normal file
@@ -0,0 +1,43 @@
|
||||
# Copy-mode selections land in the system clipboard via the terminal's own
|
||||
# OSC52 escape sequence.
|
||||
set -g set-clipboard on
|
||||
|
||||
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
|
||||
|
||||
# \ splits the pane side-by-side, - splits it stacked.
|
||||
# Both open the new pane in the current pane's directory, as does c for a new window.
|
||||
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 renumber-windows on
|
||||
|
||||
bind r source-file ~/.config/tmux/tmux.conf \; display-message "tmux.conf reloaded"
|
||||
|
||||
# Advertise RGB (true-color) capability for every terminal type.
|
||||
set -ag terminal-overrides ",*:RGB"
|
||||
|
||||
# monitor-bell flags a background window in the status bar when it rings the
|
||||
# terminal bell while unfocused.
|
||||
# bell-action=none suppresses the actual BEL (no beep or flash).
|
||||
# The per-window status highlight is independent of it.
|
||||
setw -g monitor-bell on
|
||||
set -g bell-action none
|
||||
|
||||
# Minimal status bar: session name plus window list only.
|
||||
# Colours are left to Stylix.
|
||||
set -g status-position bottom
|
||||
set -g status-left " #S "
|
||||
set -g status-left-length 20
|
||||
set -g status-right ""
|
||||
setw -g window-status-current-format " #I:#W "
|
||||
setw -g window-status-format " #I:#W "
|
||||
33
modules/shell/tmux/tmux.nix
Normal file
33
modules/shell/tmux/tmux.nix
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
# tmux for the primary user, configured through home-manager.
|
||||
# Settings without a home-manager option are read from ./extra.conf.
|
||||
let
|
||||
cfg = config.modules.shell.tmux;
|
||||
user = config.user.name;
|
||||
in
|
||||
{
|
||||
options.modules.shell.tmux.enable = lib.mkEnableOption "tmux, configured via home-manager";
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
registry.shell-shortcut.${config.networking.hostName}.tmx = "tmux new-session -A -s";
|
||||
|
||||
home-manager.users.${user}.programs.tmux = {
|
||||
enable = true;
|
||||
|
||||
prefix = "C-Space";
|
||||
keyMode = "vi";
|
||||
mouse = true;
|
||||
baseIndex = 1;
|
||||
clock24 = true;
|
||||
escapeTime = 10; # short Esc delay so exiting insert mode in nvim isn't laggy.
|
||||
historyLimit = 10000;
|
||||
terminal = "tmux-256color";
|
||||
|
||||
extraConfig = builtins.readFile ./extra.conf;
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user