nix/module/common/tmux/tmux.conf

111 lines
2.8 KiB
Plaintext
Raw Normal View History

# Remap <C-b> to <C-t>.
unbind-key C-b
set-option -g prefix C-t
bind-key C-t send-prefix
# Disable escape delay.
set -sg escape-time 0
# Reload config.
bind -n M-r source-file /etc/tmux.conf
# Scroll.
bind -n M-p copy-mode -u
bind -n M-n send-keys Pagedown
# Copy mode.
setw -g mode-keys vi
bind -n M-v copy-mode
2024-04-02 20:34:27 +03:00
bind -n M-P choose-buffer;
bind -T copy-mode-vi v send -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy"
# Remap split keys.
bind -n M-\\ split-window -h -c "#{pane_current_path}"
bind -n M-- split-window -v -c "#{pane_current_path}"
bind -n M-= select-layout tiled
bind -n M-k resize-pane -U 1
bind -n M-j resize-pane -D 1
bind -n M-h resize-pane -L 1
bind -n M-l resize-pane -R 1
bind -n M-A swap-pane -U
bind -n M-D swap-pane -D
unbind '"'
unbind %
# Swith panes with alt + hjkl.
bind -n M-a select-pane -L
bind -n M-d select-pane -R
bind -n M-w select-pane -U
bind -n M-s select-pane -D
# Close pane.
bind -n M-c kill-pane
bind -n M-C kill-pane -a
# Detach.
bind -n M-z detach-client
bind -n M-Z detach-client -a
# Switch sessions.
bind -n M-9 switch-client -p
bind -n M-0 switch-client -n
bind -n M-g choose-session
# Resize to smallest client.
set -g window-size smallest
2024-04-03 07:34:36 +03:00
# Selection style.
set -g mode-style "fg=#$bg bg=#$accent bold"
# Pane style.
set -g pane-border-style "fg=#$bg"
set -g pane-active-border-style "fg=#$bg"
# Statusbar.
2024-04-02 15:33:34 +03:00
bind-key -n M-F set-option -g status;
bind-key -n M-f run-shell 'tmux_script togglestatusbar'
set -g status-interval 2
set -g status-position bottom
set -g status-justify left
2024-04-03 07:34:36 +03:00
set -g status-style "fg=#$fg"
2024-04-03 07:34:36 +03:00
set -g status-left "#[bold,bg=#$accent,fg=#$bg] #H-#S #(tmux_script client_count #S)#[fg=#$accent,bg=default]"
2024-03-09 00:17:49 +03:00
set -g status-left-length 50
set -g status-right-length 50
2024-04-03 07:34:36 +03:00
set -g status-right "#(tmux_script statusbar) %d %a #[fg=#$accent,bg=default]#[bold,bg=#$accent,fg=#$bg] %H:%M "
set-window-option -g window-status-separator ""
2024-04-03 07:11:14 +03:00
setw -g window-status-current-style "fg=#$accent bold"
setw -g window-status-current-format " #W "
2024-04-03 07:11:14 +03:00
setw -g window-status-style ""
setw -g window-status-format " #W "
2024-03-06 20:52:06 +03:00
set-window-option -g visual-bell off
2024-04-03 07:11:14 +03:00
setw -g window-status-bell-style "bold blink"
# Create new window.
bind -n M-Escape new-window -c "#{pane_current_path}"
2024-04-03 07:11:14 +03:00
bind -n M-t new-window -c "#{pane_current_path}"
# Close window.
bind -n M-x kill-window
bind -n M-X kill-window -a
# Switch window.
bind -n M-e next-window
bind -n M-q previous-window
# Move window.
bind -n M-E swap-window -t +1\; select-window -t +1
bind -n M-Q swap-window -t -1\; select-window -t -1
2024-03-06 20:52:06 +03:00
# Env.
set-option -g default-terminal "tmux-256color"
set-option -g focus-events on
set-option -sa terminal-features "RGB"
2024-03-26 02:13:52 +03:00
set-option -g update-environment "SSH_CLIENT SSH_TTY DOCKER_CONFIG DOCKER_HOST DISPLAY XAUTHORITY BASH_PATH"