58 lines
1.9 KiB
Bash
58 lines
1.9 KiB
Bash
setw -g mode-keys vi
|
|
#unbind ^b
|
|
#set -g prefix 'C-a'
|
|
#set -g prefix `
|
|
#bind-key ` send-prefix
|
|
bind r source-file ~/.tmux.conf \; display-message "Config reloaded"
|
|
|
|
# 切分面板
|
|
# unbind '"'
|
|
bind - splitw -v -c '#{pane_current_path}'
|
|
# unbind %
|
|
bind | splitw -h -c '#{pane_current_path}'
|
|
|
|
# 开启 24bit 真彩色,tmux > 2.2 开始支持
|
|
set -g default-terminal "screen-256color"
|
|
set-option -ga terminal-overrides ",*256col*:Tc"
|
|
|
|
set-option -g mouse on
|
|
|
|
# 绑定hjkl键为面板切换的上下左右键
|
|
bind k select-pane -U # 绑定k为↑
|
|
bind j select-pane -D # 绑定j为↓
|
|
#bind h select-pane -L # 绑定h为←
|
|
#bind l select-pane -R # 绑定l为→
|
|
|
|
# 绑定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个单元格
|
|
|
|
bind -r j select-pane -t .+1 \; resize-pane -Z # prefix + j to switch pane in current window
|
|
|
|
# 设置tmux的延迟,文档说当有干扰的时候可以设置这个参数,比如影响vim编辑的时候
|
|
set -s escape-time 1
|
|
|
|
# 返回上一个窗口
|
|
bind L switch-client -l
|
|
|
|
# 设置窗口名为当前目录名
|
|
set-option -g status-interval 10
|
|
set-option -g automatic-rename on
|
|
set-option -g automatic-rename-format '#{b:pane_current_path}'
|
|
|
|
set-option -g set-titles on
|
|
#set-option -g set-titles-string "#{session_name} - #{host}"
|
|
set-option -g set-titles-string "#{session_name}"
|
|
|
|
# List of plugins
|
|
set -g @plugin 'tmux-plugins/tpm'
|
|
set -g @plugin 'tmux-plugins/tmux-sensible'
|
|
set -g @plugin 'junegunn/fzf'
|
|
set -g @plugin 'tmux-plugins/tmux-fzf'
|
|
set -g @plugin 'tmux-plugins/tmux-resurrect'
|
|
|
|
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
|
|
run '~/.tmux/plugins/tpm/tpm'
|