add reverseSplitBindings option
This commit is contained in:
parent
4ec530e8b5
commit
905fe60936
3 changed files with 28 additions and 3 deletions
11
CHANGELOG
11
CHANGELOG
|
|
@ -1,3 +1,14 @@
|
|||
2026-05-16
|
||||
- The reversed split-window key bindings previously generated by
|
||||
`programs.tmux.enableSensible` are no longer emitted when
|
||||
`system.stateVersion` is 7 or later, so tmux uses its conventional
|
||||
behavior: `%` splits the current pane horizontally and `"` splits it
|
||||
vertically.
|
||||
|
||||
Existing configurations with `system.stateVersion` 6 or earlier keep
|
||||
the previous reversed bindings. You can explicitly choose either
|
||||
behavior with `programs.tmux.reverseSplitBindings`.
|
||||
|
||||
2026-02-10
|
||||
- Major changes to `homebrew` module
|
||||
|
||||
|
|
|
|||
|
|
@ -57,6 +57,17 @@ in
|
|||
description = "Enable sensible configuration options for tmux.";
|
||||
};
|
||||
|
||||
programs.tmux.reverseSplitBindings = mkOption {
|
||||
type = types.bool;
|
||||
default = config.system.stateVersion <= 6 && cfg.enableSensible;
|
||||
defaultText = literalExpression "config.system.stateVersion <= 6 && config.programs.tmux.enableSensible";
|
||||
example = true;
|
||||
description = ''
|
||||
Whether to reverse the `%` and `"` split-window key bindings
|
||||
emitted by the tmux module.
|
||||
'';
|
||||
};
|
||||
|
||||
programs.tmux.enableMouse = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
|
|
@ -127,8 +138,6 @@ in
|
|||
set -s escape-time 0
|
||||
|
||||
bind c new-window -c '#{pane_current_path}'
|
||||
bind % split-window -h -c '#{pane_current_path}'
|
||||
bind '"' split-window -v -c '#{pane_current_path}'
|
||||
|
||||
# TODO: make these interactive
|
||||
bind C new-session
|
||||
|
|
@ -138,6 +147,11 @@ in
|
|||
# set -g utf8 on
|
||||
'';
|
||||
|
||||
programs.tmux.tmuxOptions.splitBindings.text = mkIf cfg.reverseSplitBindings ''
|
||||
bind % split-window -v -c '#{pane_current_path}'
|
||||
bind '"' split-window -h -c '#{pane_current_path}'
|
||||
'';
|
||||
|
||||
programs.tmux.tmuxOptions.mouse.text = mkIf cfg.enableMouse ''
|
||||
set -g mouse on
|
||||
setw -g mouse on
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ in
|
|||
system.maxStateVersion = mkOption {
|
||||
internal = true;
|
||||
type = types.int;
|
||||
default = 6;
|
||||
default = 7;
|
||||
};
|
||||
|
||||
system.darwinLabel = mkOption {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue