Skip to content

Instantly share code, notes, and snippets.

@1a1a11a
Last active September 25, 2024 00:00
Show Gist options
  • Save 1a1a11a/e7e6dfcdf4cbf67bb54384b8090549b4 to your computer and use it in GitHub Desktop.
Save 1a1a11a/e7e6dfcdf4cbf67bb54384b8090549b4 to your computer and use it in GitHub Desktop.
# change control key to ctrl + a
unbind C-b
set -g prefix C-a
# set screen history
set -g history-limit 40000
# use r to reload config
bind r source-file ~/.tmux.conf \; display-message "Config reloaded.."
# use - and | to create new horizontal and vertical pane
unbind '"'
bind - splitw -v -c '#{pane_current_path}'
unbind %
bind | splitw -h -c '#{pane_current_path}'
# bind -r k select-pane -U # 绑定k为↑
# bind -r j select-pane -D # 绑定j为↓
# bind -r h select-pane -L # 绑定h为←
# bind -r l select-pane -R # 绑定l为→
# use s to synchronize pane
bind-key s set-window-option synchronize-panes\; display-message "synchronize-panes is now #{?pane_synchronized,on,off}"
# 绑定Ctrl+hjkl键为面板上下左右调整边缘的快捷指令
# bind -r ^k resizep -U 10 # 绑定Ctrl+k为往↑调整面板边缘10个单元格
# bind -r ^j resizep -D 10 # 绑定Ctrl+j为往↓调整面板边缘10个单元格
# bind -r ^h resizep -L 10 # 绑定Ctrl+h为往←调整面板边缘10个单元格
# bind -r ^l resizep -R 10 # 绑定Ctrl+l为往→调整面板边缘10个单元格
# status bar
# color
set -g status-bg colour234
set -g status-fg colour8
set -g status-bg black
set -g status-fg white
# alignment
set-option -g status-justify centre
# left
set-option -g status-left '#[bg=black,fg=green][#[fg=cyan]#S#[fg=green]]'
setw -g automatic-rename on
# right
set-option -g status-right '#[fg=green][#[fg=cyan]%m-%d %H:%M#[fg=green]]'
set -s escape-time 50
# start numbering windows from 1 instead of zero
set -g base-index 1
# syntax highlighting in Vim
set -g default-terminal "screen-256color"
# window list
set -g window-status-format "#[fg=colour8] #I #[fg=colour231]#W#[fg=colour166]#F "
set -g window-status-current-format "#[fg=colour117,bg=colour31] #I #[fg=colour231]#W#[fg=colour234]#F "
set -g window-status-separator ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment