63 lines
1.8 KiB
Nix
63 lines
1.8 KiB
Nix
{ pkgs, config, lib, ... }:
|
|
with lib;
|
|
let cfg = config.eboskma.programs.tmux;
|
|
in
|
|
{
|
|
options.eboskma.programs.tmux = {
|
|
enable = mkEnableOption "enable tmux";
|
|
};
|
|
|
|
config = mkIf (cfg.enable) {
|
|
programs.tmux = {
|
|
enable = true;
|
|
shortcut = "a";
|
|
terminal = "tmux-256color";
|
|
clock24 = true;
|
|
baseIndex = 1;
|
|
keyMode = "vi";
|
|
|
|
extraConfig = ''
|
|
source ${pkgs.powerline}/share/tmux/powerline.conf
|
|
setw -g automatic-rename
|
|
|
|
set -ag update-environment "SWAYSOCK"
|
|
|
|
bind-key r source ~/.tmux.conf \; display "Reloaded config."
|
|
|
|
bind-key C-a send-prefix
|
|
|
|
bind-key | split-window -h
|
|
bind-key - split-window -v
|
|
|
|
bind-key h select-pane -L
|
|
bind-key n select-pane -D
|
|
bind-key e select-pane -U
|
|
bind-key i select-pane -R
|
|
|
|
bind-key -r C-h select-window -t :-
|
|
bind-key -r C-i select-window -t :+
|
|
|
|
bind-key -r H resize-pane -L 5
|
|
bind-key -r N resize-pane -D 5
|
|
bind-key -r E resize-pane -U 5
|
|
bind-key -r I resize-pane -R 5
|
|
|
|
bind-key C-[ swap-window -t -1
|
|
bind-key C-] swap-window -t +1
|
|
|
|
bind-key -T copy-mode-vi h send-keys -X cursor-left
|
|
bind-key -T copy-mode-vi n send-keys -X cursor-down
|
|
bind-key -T copy-mode-vi e send-keys -X cursor-up
|
|
bind-key -T copy-mode-vi i send-keys -X cursor-right
|
|
|
|
set -g mouse on
|
|
bind-key -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
|
|
bind-key -n WheelDownPane select-pane -t= \; send-keys -M
|
|
'';
|
|
};
|
|
|
|
home.packages = with pkgs; [
|
|
powerline
|
|
];
|
|
};
|
|
}
|