autostart tmux

This commit is contained in:
Daniel Bauer
2025-08-01 16:24:52 +02:00
parent b2582dde84
commit ced9a3c088
2 changed files with 39 additions and 2 deletions

View File

@@ -1,11 +1,38 @@
set-window-option -g xterm-keys on set-window-option -g xterm-keys on
# make tmux respect terminal color settings
set -g default-terminal "tmux-256color"
set -s escape-time 10 # faster command timeout set -s escape-time 10 # faster command timeout
set -g history-limit 10000 set -g history-limit 10000
set -g status-interval 2 set -g status-interval 2
# enable mouse
set-option -g mouse on set-option -g mouse on
# remap prefix key to Ctrl+S
unbind C-b
set-option -g prefix C-s
bind-key C-s send-prefix
# split windows with | and ^
bind | split-window -h
unbind %
bind ^ split-window -v
unbind '"'
# start counting windows from 1
set -g base-index 1
setw -g pane-base-index 1
# don't do anything when a 'bell' rings
set -g visual-activity off
set -g visual-bell off
set -g visual-silence off
setw -g monitor-activity off
set -g bell-action none
# make scrolling with wheels work # make scrolling with wheels work
bind -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 -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 -n WheelDownPane select-pane -t= \; send-keys -M bind -n WheelDownPane select-pane -t= \; send-keys -M
@@ -22,6 +49,11 @@ set -g @plugin 'kiyoon/treemux'
run -b '~/.tmux/plugins/tpm/tpm' run -b '~/.tmux/plugins/tpm/tpm'
# status bar
set -g status-position bottom
setw -g window-status-current-style 'fg=black bg=red'
setw -g window-status-current-format ' #I #W #F '
# set -g status-right '#{cpu_bg_color} CPU: #{cpu_percentage} GPU: #{gpu} RAM: #{ram}| %a %h-%d %H:%M ' # set -g status-right '#{cpu_bg_color} CPU: #{cpu_percentage} GPU: #{gpu} RAM: #{ram}| %a %h-%d %H:%M '
# Status line color # Status line color
set -g status-style fg=colour136,bg=colour235 set -g status-style fg=colour136,bg=colour235

View File

@@ -1,3 +1,8 @@
# autostart tmux if possible
if command -v tmux &> /dev/null && [ -z "$TMUX" ]; then
exec tmux
fi
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. # Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n] # Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below. # confirmations, etc.) must go above this block; everything else may go below.
@@ -17,6 +22,8 @@ LOCAL_ENV_FILE="$HOME/.environment.local"
ALIAS_FILE="$HOME/.aliases" ALIAS_FILE="$HOME/.aliases"
LOCAL_ALIAS_FILE="$HOME/.aliases.local" LOCAL_ALIAS_FILE="$HOME/.aliases.local"
source $ENV_FILE source $ENV_FILE
if [ -f $LOCAL_ENV_FILE ]; then if [ -f $LOCAL_ENV_FILE ]; then
source $LOCAL_ENV_FILE source $LOCAL_ENV_FILE
@@ -43,5 +50,3 @@ export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
[ -s "$HOME/.cargo/env" ] && \. "$HOME/.cargo/env" # Load cargo env [ -s "$HOME/.cargo/env" ] && \. "$HOME/.cargo/env" # Load cargo env