{
  pkgs,
  config,
  ...
}: {
  programs.tmux = {
    enable = true;
    shell = "${pkgs.fish}/bin/fish";
    terminal = "tmux-256color";
    historyLimit = 100000;
    plugins = with pkgs.tmuxPlugins; [
      vim-tmux-navigator
    ];
    escapeTime = 0;
    mouse = true;

    extraConfig = ''
      set -g destroy-unattached on

      unbind C-b
      set -g prefix C-Space
      bind C-Space send-prefix

      set -g base-index 1
      set -g pane-base-index 1
      set-window-option -g pane-base-index 1
      set -g renumber-windows on

      bind -n M-H previous-window
      bind -n M-: next-window

      set-window-option -g mode-keys vi

      bind-key -T copy-mode-vi v send-keys -X begin-selection
      bind-key -T copy-mode-vi C-v send-keys -X rectangle-selection
      bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
      unbind %
      unbind '"'
      bind ']' split-window -v -c "#{pane_current_path}"
      bind '\' split-window -h -c "#{pane_current_path}"
      bind C-l send-keys 'C-l'
    '';
  };
}