2021-03-13 01:02:34 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
let
|
|
|
|
cfg = config.my.home.tmux;
|
|
|
|
in
|
2021-02-20 15:34:33 +01:00
|
|
|
{
|
2021-03-13 01:02:34 +01:00
|
|
|
options.my.home.tmux = with lib.my; {
|
|
|
|
enable = mkDisableOption "tmux terminal multiplexer";
|
|
|
|
};
|
|
|
|
|
|
|
|
config.programs.tmux = lib.mkIf cfg.enable {
|
2021-02-20 15:34:33 +01:00
|
|
|
enable = true;
|
|
|
|
|
|
|
|
clock24 = true; # I'm one of those heathens
|
|
|
|
escapeTime = 0; # Let vim do its thing instead
|
|
|
|
historyLimit = 5000; # Bigger buffer
|
2021-02-20 15:51:54 +01:00
|
|
|
terminal = "tmux-256color"; # I want accurate termcap info
|
2021-02-20 15:37:39 +01:00
|
|
|
|
|
|
|
plugins = with pkgs.tmuxPlugins; [
|
|
|
|
# Open high-lighted files in copy mode
|
|
|
|
open
|
|
|
|
# Better pane management
|
|
|
|
pain-control
|
|
|
|
# Better session management
|
|
|
|
sessionist
|
|
|
|
# X clipboard integration
|
|
|
|
yank
|
|
|
|
{
|
|
|
|
# Show when prefix has been pressed
|
|
|
|
plugin = prefix-highlight;
|
|
|
|
extraConfig = ''
|
|
|
|
# Also show when I'm in copy or sync mode
|
|
|
|
set -g @prefix_highlight_show_copy_mode 'on'
|
|
|
|
set -g @prefix_highlight_show_sync_mode 'on'
|
|
|
|
# Show prefix mode in status bar
|
|
|
|
set -g status-right '#{prefix_highlight} %a %Y-%m-%d %H:%M'
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
];
|
2021-02-20 15:46:39 +01:00
|
|
|
|
|
|
|
extraConfig = ''
|
|
|
|
# Better vim mode
|
|
|
|
bind-key -T copy-mode-vi 'v' send -X begin-selection
|
|
|
|
bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel
|
|
|
|
'';
|
2021-02-20 15:34:33 +01:00
|
|
|
};
|
|
|
|
}
|