feat: tmux config update

master
Tim 1 year ago
parent 0b5c36d10e
commit d1b1789237

@ -0,0 +1,57 @@
# Change the prefix key (screen friendly).
set -g prefix C-a
unbind-key C-b
bind-key C-a send-prefix
# Keys to switch session.
bind-key q switchc -t0
bind-key w switchc -t1
bind-key e switchc -t2
# Other key bindings.
bind-key i choose-window
bind-key m setw monitor-activity
bind-key y setw force-width 81
bind-key u setw force-width 0
bind-key D detach \; lock
bind-key N neww \; splitw -d
# Open new/split panes with the path of the current pane.
unbind c
bind c new-window -c '#{pane_current_path}'
unbind %
bind % split-window -h -c '#{pane_current_path}'
unbind '"'
bind '"' split-window -v -c '#{pane_current_path}'
# Vim-like key bindings for pane navigation (default uses cursor keys).
unbind h
bind h select-pane -L
unbind j
bind j select-pane -D
unbind k
bind k select-pane -U
unbind l # normally used for last-window
bind l select-pane -R
# Resizing (mouse also works).
unbind Left
bind -r Left resize-pane -L 5
unbind Right
bind -r Right resize-pane -R 5
unbind Down
bind -r Down resize-pane -D 5
unbind Up
bind -r Up resize-pane -U 5
# Fast toggle (normally prefix-l).
bind ^space last-window
# Intuitive window-splitting keys.
bind '|' split-window -h -c '#{pane_current_path}' # normally prefix-%
bind '\' split-window -h -c '#{pane_current_path}' # normally prefix-%
bind '-' split-window -v -c '#{pane_current_path}' # normally prefix-"

@ -0,0 +1,47 @@
# Default global options.
set -g bell-action none
#set -g default-terminal "screen-256color"
set -g default-terminal tmux-256color
set -ga terminal-overrides ,*256col*:Tc
set -g history-limit 262144
# Start window and pane numbering at 1, (0 is too hard to reach).
set -g base-index 1
set -g pane-base-index 1
# Don't wait for an escape sequence after seeing C-a.
set -s escape-time 0
# Dynamically update iTerm tab and window titles.
set -g set-titles on
# But don't change tmux's own window titles.
set -w -g automatic-rename off
# Don't wrap searches; it's super confusing given tmux's reverse-ordering of
# position info in copy mode.
set -w -g wrap-search off
set -g aggressive-resize on # for attaching like screen
# Automatically renumber window numbers on closing a pane (tmux >= 1.7).
set -g renumber-windows on
# Mouse can be used to select panes, select windows (by clicking on the status
# bar), resize panes. For default bindings see `tmux list-keys` and `tmux
# list-keys -t vi-copy`.
set -g mouse on
# Default global window options
set-window-option -g mode-keys vi
# Restore pre-2.1 behavior of scrolling with the scroll wheel in Vim, less, copy
# mode etc, otherwise entering copy mode if not already in it.
bind-key -T root WheelUpPane \
if-shell -Ft= '#{?pane_in_mode,1,#{mouse_any_flag}}' \
'send -Mt=' \
'if-shell -Ft= "#{alternate_on}" "send -t= Up" "copy-mode -et="'
bind-key -T root WheelDownPane \
if-shell -Ft = '#{?pane_in_mode,1,#{mouse_any_flag}}' \
'send -Mt=' \
'if-shell -Ft= "#{alternate_on}" "send -t= Down" "send -Mt="'

@ -0,0 +1,44 @@
set -g status-bg green
set -g status-keys vi
set -g status-right-length 60
# statusbar --------------------------------------------------------------
# Show messages and notifications for 2 seconds.
set -g display-time 3000
# Refresh the status bar every 1 second.
set -g status-interval 1
# The status bar itself.
set -g status-left "[#S]"
set -g status-interval 60
#set -g status-right "#(uptime)"
#### COLOUR
# default statusbar colors
set -g status-bg colour235 #base02
set -g status-fg colour136 #yellow
# default window title colors
set-window-option -g window-status-style fg=colour244
set-window-option -g window-status-style bg=default
set-window-option -g window-status-style dim
# active window title colors
set-window-option -g window-status-current-style fg=colour166 #orange
set-window-option -g window-status-current-style bg=default
set-window-option -g window-status-current-style bright
# pane border
set -g pane-border-style fg=colour235 #base02
set -g pane-active-border-style fg=colour240 #base01
# message text
set -g message-style bg=colour235 #base02
set -g message-style fg=colour166 #orange
# pane number display
set -g display-panes-active-colour colour33 #blue
set -g display-panes-colour colour166 #orange

@ -1,73 +1,8 @@
# Change the prefix key (screen friendly).
set-option -g prefix C-a
unbind-key C-b
bind-key C-a send-prefix
# Tmux
# Default global options.
set-option -g bell-action none
set-option -g default-terminal "screen-256color"
set-option -g status-bg green
set-option -g status-keys vi
set-option -g status-right-length 60
set-option -g aggressive-resize on # for attaching like screen
TMUX_PATH=/home/$USER/.config/tmux
# Default global window options
set-window-option -g mode-keys vi
#set-window-option -g utf8 on
# Keys to switch session.
bind-key q switchc -t0
bind-key w switchc -t1
bind-key e switchc -t2
# Other key bindings.
bind-key i choose-window
bind-key m setw monitor-activity
bind-key y setw force-width 81
bind-key u setw force-width 0
bind-key D detach \; lock
bind-key N neww \; splitw -d
# statusbar --------------------------------------------------------------
# Show messages and notifications for 2 seconds.
set-option -g display-time 3000
# Refresh the status bar every 1 second.
set-option -g status-interval 1
# The status bar itself.
set-option -g status-left "[#S]"
#set-option -g status-right "#(uptime)"
#### COLOUR
# default statusbar colors
set-option -g status-bg colour235 #base02
set-option -g status-fg colour136 #yellow
#set-option -g status default
# default window title colors
set-window-option -g window-status-style fg=colour244
set-window-option -g window-status-style bg=default
set-window-option -g window-status-style dim
# active window title colors
set-window-option -g window-status-current-style fg=colour166 #orange
set-window-option -g window-status-current-style bg=default
set-window-option -g window-status-current-style bright
# pane border
set-option -g pane-border-style fg=colour235 #base02
set-option -g pane-active-border-style fg=colour240 #base01
# message text
set-option -g message-style bg=colour235 #base02
set-option -g message-style fg=colour166 #orange
# pane number display
set-option -g display-panes-active-colour colour33 #blue
set-option -g display-panes-colour colour166 #orange
# Sourcing files
source-file $TMUX_PATH/bindings.tmux
source-file $TMUX_PATH/general.tmux
source-file $TMUX_PATH/theme.tmux

Loading…
Cancel
Save