Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fb5edb0326 | |||
| 1d1d80f2f6 | |||
| 4db0b400ac | |||
| 9423387093 | |||
| 406922cdf1 |
177
.tmux.conf
177
.tmux.conf
@@ -1,105 +1,118 @@
|
|||||||
## make tmux display things in 256 colors
|
#########################################
|
||||||
## Getting italics working correctly in tmux
|
# Basic Settings and Prefix
|
||||||
## https://unix.stackexchange.com/a/745718
|
#########################################
|
||||||
set -g default-terminal "tmux-256color"
|
|
||||||
|
|
||||||
## set scrollback history to 10000 (10k)
|
set-option -g prefix C-a # Set Ctrl-a as the prefix key
|
||||||
set -g history-limit 10000
|
unbind C-b # Unbind the default Ctrl-b prefix
|
||||||
|
set -sg escape-time 1 # Shorten command delay for faster responsiveness
|
||||||
|
|
||||||
## set Ctrl-a as the default prefix key combination
|
#########################################
|
||||||
## and unbind C-b to free it up
|
# Terminal and Display
|
||||||
set -g prefix C-a
|
#########################################
|
||||||
unbind C-b
|
|
||||||
|
|
||||||
## reload ~/.tmux.conf using PREFIX r
|
set-option -g default-terminal "tmux-256color" # Force tmux to use 256 colors if supported by the terminal
|
||||||
|
|
||||||
|
#########################################
|
||||||
|
# History and Indexing
|
||||||
|
#########################################
|
||||||
|
|
||||||
|
set-option -g history-limit 10000 # Set the scrollback history limit to 10,000 lines
|
||||||
|
set-option -g base-index 1 # Start window indexing at 1 (instead of 0)
|
||||||
|
set-option -g pane-base-index 1 # Start pane indexing at 1 (instead of 0)
|
||||||
|
|
||||||
|
#########################################
|
||||||
|
# Key Bindings
|
||||||
|
#########################################
|
||||||
|
|
||||||
|
# Reload tmux configuration
|
||||||
bind r source-file ~/.tmux.conf \; display "Reloaded!"
|
bind r source-file ~/.tmux.conf \; display "Reloaded!"
|
||||||
|
|
||||||
## map Vi movement keys as pane movement keys
|
# Window Management
|
||||||
bind h select-pane -L
|
bind Tab next-window # Cycle to the next window
|
||||||
bind j select-pane -D
|
bind , command-prompt "rename-window '%%'" # Open a prompt to rename the current window
|
||||||
bind k select-pane -U
|
|
||||||
bind l select-pane -R
|
|
||||||
|
|
||||||
# resize panes using PREFIX H, J, K, L
|
# Pane Management
|
||||||
bind -r H resize-pane -L 2
|
bind | split-window -h # Split the current window horizontally
|
||||||
bind -r J resize-pane -D 2
|
bind - split-window -v # Split the current window vertically
|
||||||
bind -r K resize-pane -U 2
|
|
||||||
bind -r L resize-pane -R 2
|
|
||||||
|
|
||||||
## PREFIX | to split horizontally
|
# Pane Selection (Vi-style movement)
|
||||||
## PREFIX - to split vertically
|
bind h select-pane -L # Select the pane to the left
|
||||||
bind | split-window -h
|
bind j select-pane -D # Select the pane below
|
||||||
bind - split-window -v
|
bind k select-pane -U # Select the pane above
|
||||||
|
bind l select-pane -R # Select the pane to the right
|
||||||
|
|
||||||
## shorten command delay
|
# Pane Resizing
|
||||||
set -sg escape-time 1
|
bind -r H resize-pane -L 2 # Resize the current pane 2 cells to the left (repeatable with -r)
|
||||||
|
bind -r J resize-pane -D 2 # Resize the current pane 2 cells down (repeatable with -r)
|
||||||
|
bind -r K resize-pane -U 2 # Resize the current pane 2 cells up (repeatable with -r)
|
||||||
|
bind -r L resize-pane -R 2 # Resize the current pane 2 cells to the right (repeatable with -r)
|
||||||
|
|
||||||
## Tab through active windows
|
#########################################
|
||||||
bind Tab next-window
|
# Visual Notifications
|
||||||
|
#########################################
|
||||||
|
|
||||||
## Rename window
|
set-option -g monitor-activity on # Enable monitoring of activity in other windows
|
||||||
bind , command-prompt "rename-window '%%'"
|
set-option -g visual-activity on # Enable visual notification of activity in other windows
|
||||||
|
|
||||||
## ----------------------
|
#########################################
|
||||||
## Status Bar
|
# Status Bar
|
||||||
## -----------------------
|
#########################################
|
||||||
set -g status on # turn the status bar on
|
|
||||||
set -g status-interval 5 # set update frequencey (default 15 seconds)
|
|
||||||
set -g status-justify centre # center window list for clarity
|
|
||||||
|
|
||||||
## ----------------------
|
set-option -g status on # Turn the status bar on
|
||||||
## set some pretty colors
|
set-option -g status-interval 5 # Set the status bar update frequency to 5 seconds
|
||||||
## ----------------------
|
set-option -g status-justify centre # Justify the window list to the left
|
||||||
## set pane colors - hilight the active pane
|
|
||||||
set -g pane-border-style bg=colour0,fg=colour8
|
|
||||||
set -g pane-active-border-style bg=colour0,fg=colour2
|
|
||||||
|
|
||||||
## colorize messages in the command line
|
# Left side of the status bar
|
||||||
set-option -g message-style bg=colour0,fg=colour13
|
set-option -g status-left-length 70 # Set the maximum length of the left side of the status bar
|
||||||
|
set-option -g status-left "#h ◆" # Display the hostname on the left, followed by some visual separators
|
||||||
|
|
||||||
## set window list colors
|
# Right side of the status bar
|
||||||
setw -g window-status-style fg=colour8,bg=colour0
|
set-option -g status-right-length 60 # Set the maximum length of the right side of the status bar
|
||||||
setw -g window-status-current-style fg=colour2,bg=colour0,bright
|
set-option -g status-right "S:#S W:#I P:#P | %b %d %H:%M" # Display session name, window index, pane index, and the date/time on the right
|
||||||
|
|
||||||
## Titles
|
# Status bar style
|
||||||
set -g set-titles on
|
set-option -g status-style bg=#000000,fg=grey # Set the background to default (transparent), foreground color, and brightness
|
||||||
set -g set-titles-string '#H:#S.#I.#P #W #T' # window number,program name, active(or not)
|
|
||||||
|
|
||||||
#set inactive/active window styles
|
#########################################
|
||||||
# set -g window-style fg=colour0,bg=colour0
|
# Pane Appearance
|
||||||
# set -g window-active-style fg=colour7,bg=colour0
|
#########################################
|
||||||
# -- or --
|
|
||||||
# These make tmux transparent again
|
|
||||||
set -g window-style bg=default
|
|
||||||
set -g window-active-style bg=default
|
|
||||||
|
|
||||||
## Status Bar: color
|
set-option -g pane-border-style bg=colour0,fg=colour8 # Style for inactive pane borders
|
||||||
set-option -g status-style bg=colour0,fg=colour8,bright
|
set-option -g pane-active-border-style bg=colour0,fg=colour2 # Style for the active pane border
|
||||||
|
|
||||||
## Status Bar: Left - hostname
|
#########################################
|
||||||
set -g status-left-length 70
|
# Message Appearance
|
||||||
set -g status-left "#h"
|
#########################################
|
||||||
|
|
||||||
## Status Bar: Right - Session name, Window & Pane, Date & Time
|
set-option -g message-style bg=default,fg=colour13 # Style for messages displayed in the tmux command line
|
||||||
set -g status-right-length 60
|
|
||||||
set -g status-right "S:#S W:#I P:#P | %Y-%m-%d %H:%M"
|
|
||||||
|
|
||||||
# set window and pane index to 1 (0 by default)
|
#########################################
|
||||||
set -g base-index 1
|
# Window Appearance
|
||||||
setw -g pane-base-index 1
|
#########################################
|
||||||
|
|
||||||
## visual notification of activity in other windows
|
set-window-option -g window-style bg=default # Default background color for windows
|
||||||
setw -g monitor-activity on
|
set-window-option -g window-active-style bg=default # Background color for the active window
|
||||||
set -g visual-activity on
|
|
||||||
|
|
||||||
# ----------------------------------
|
#########################################
|
||||||
|
# Window List Appearance
|
||||||
|
#########################################
|
||||||
|
|
||||||
# ## use send-prefix to pass C-a through to application
|
#set-window-option -g window-status-style fg=blue # Or your preferred inactive style
|
||||||
# #bind C-a send-prefix
|
#set-window-option -g window-status-format "#[fg=blue] #I:#W#[fg=blue]#{?window_activity_flag,#[fg=yellow bg=default]!,}"
|
||||||
#
|
#set-window-option -g window-status-current-style fg=green,bright
|
||||||
# ## Make the current window the first window
|
#set-window-option -g window-status-current-format "#[fg=green,bright]● #I:#W ●#[fg=green]"
|
||||||
# bind T swap-window -t 1
|
|
||||||
#
|
# Stolen from https://github.com/mhartington/dotfiles/blob/main/config/tmux/tmux-status.conf
|
||||||
# set-option -g display-panes-active-colour colour2
|
|
||||||
# set-option -g display-panes-colour colour1
|
# Not active window
|
||||||
#
|
set-window-option -g window-status-format "#{?window_activity_flag,#[bg=#ffff00 fg=#000000 bold],#[fg=#228b22 bg=default]}#I:#W"
|
||||||
|
|
||||||
|
# Active window
|
||||||
|
set-window-option -g window-status-current-format "#[bg=default fg=#7cfc00]● #I:#W"
|
||||||
|
|
||||||
|
#########################################
|
||||||
|
# Window Titles
|
||||||
|
#########################################
|
||||||
|
|
||||||
|
set-option -g set-titles on # Enable automatic window titles
|
||||||
|
set-option -g set-titles-string '#H:#S.#I.#P #W #T' # Format string for window titles (hostname:session.window_index.pane_index window_number window_name)
|
||||||
|
|||||||
Reference in New Issue
Block a user