config: basic tmux for nixos 🎨 💩
This commit is contained in:
parent
c36ba522a7
commit
2bc9af274e
2 changed files with 85 additions and 13 deletions
57
nixos/tmux.nix
Normal file
57
nixos/tmux.nix
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
|
||||
programs.tmux = {
|
||||
enable = true;
|
||||
clock24 = true;
|
||||
extraConfig = ''
|
||||
# remap prefix from ^+A to ^+B (for nested tmux sessions)
|
||||
unbind C-b
|
||||
set -g prefix M-f
|
||||
bind M-f send-prefix
|
||||
|
||||
# nvim 'checkhealth' advice
|
||||
set-option -g focus-events on
|
||||
set-option -g default-terminal "screen-256color"
|
||||
set-option -sa terminal-overrides ',xterm-256color:RGB'
|
||||
|
||||
# enable mouse support for switching panes/windows
|
||||
# set -g mouse on
|
||||
|
||||
# extend history
|
||||
set -g history-limit 100000
|
||||
|
||||
# set vi keybindings
|
||||
setw -g mode-keys vi
|
||||
bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xsel -i --clipboard"
|
||||
|
||||
# reduce escape time
|
||||
set-option -sg escape-time 20
|
||||
|
||||
# pane movement shortcuts
|
||||
bind h select-pane -L
|
||||
bind j select-pane -D
|
||||
bind k select-pane -U
|
||||
bind l select-pane -R
|
||||
|
||||
# window selection
|
||||
bind -r C-h select-window -t :-
|
||||
bind -r C-l select-window -t :+
|
||||
|
||||
# Resize pane shortcuts
|
||||
bind -r H resize-pane -L 10
|
||||
bind -r J resize-pane -D 10
|
||||
bind -r K resize-pane -U 10
|
||||
bind -r L resize-pane -R 10
|
||||
|
||||
# split with dash and vbar
|
||||
bind | split-window -h -c "#{pane_current_path}"
|
||||
bind - split-window -v -c "#{pane_current_path}"
|
||||
|
||||
# server-tmux only:
|
||||
# fix ssh agent when tmux is detached
|
||||
# setenv -g SSH_AUTH_SOCK $HOME/.ssh/ssh_auth_sock
|
||||
'';
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue