以下是 ~/.tmux.conf 文件的内容,主要是修改了默认的快捷键,ctrl+b改为ctrl+a。
退出改为了ctrl+a, q,其余的可以参见配置。
git 仓库地址:dev-config
# use C-a, since it's on the home row and easier to hit than C-b
set-option -g prefix C-a
unbind-key C-a
bind-key C-a send-prefix
set -g base-index 1
# vi is good
setw -g mode-keys vi
# mouse behavior
# setw -g mode-mouse on
# set -g mouse-select-pane on
# set -g mouse-resize-pane on
set -g history-limit 65535
# set-option -g default-terminal screen-256color
bind-key : command-prompt
bind-key r refresh-client
bind-key L clear-history
# bind-key space next-window
bind-key bspace previous-window
bind-key enter next-layout
# use vim-like keys for splits and windows
bind-key v split-window -h
bind-key s split-window -v
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
bind-key C-o rotate-window
bind-key + select-layout main-horizontal
bind-key = select-layout main-vertical
set-window-option -g other-pane-height 25
set-window-option -g other-pane-width 80
bind-key a last-pane
bind-key q display-panes
bind-key c new-window
# bind-key t next-window
# bind-key T previous-window
bind -n 'F11' previous-window
bind -n 'F12' next-window
# kill pane (prefix q)
bind q killp
# kill window (prefix Ctrl+q)
bind ^q killw
bind K killw
bind-key [ copy-mode
bind-key ] paste-buffer
# Clunkily connect tmux buffers with the pasteboard.
bind-key y run "tmux save-buffer - | reattach-to-user-namespace pbcopy"
#set-window-option display-panes-time 1500
set-option -g display-panes-time 1500
# Status Bar
set-option -g status-interval 1
set-option -g status-left ''
# set-option -g status-right '%H:%M%p'
set-option -g status-right '%H:%M'
set-window-option -g window-status-current-fg magenta
set-option -g status-fg default
# test add
set-option -g display-time 5000 #提示信息的持续时间;设置足够的时间以避免看不清提示,单位为毫秒
set-option -g repeat-time 1000 #控制台激活后的持续时间;设置合适的时间以避免每次操作都要先激活控制台,单位为毫秒
set-option -g status-keys vi #操作状态栏时的默认键盘布局;可以设置为vi或emacs
#set-option -g status-right "#(date +%H:%M' ')" #状态栏右方的内容;这里的设置将得到类似23:59的显示
set-option -g status-right-length 10 #状态栏右方的内容长度;建议把更多的空间留给状态栏左方(用于列出当前窗口)
set-option -g status-utf8 on #开启状态栏的UTF-8支持
#set -g status-left "#[fg=colour52]#S #[fg=yellow]#I #[fg=cyan]#P"
#set -g status-left '#[fg=green]#H'
# Status Bar solarized-dark (default)
set-option -g status-bg black
set-option -g pane-active-border-fg black
set-option -g pane-border-fg black
# Status Bar solarized-light
if-shell "[ \"$COLORFGBG\" = \"11;15\" ]" "set-option -g status-bg white"
if-shell "[ \"$COLORFGBG\" = \"11;15\" ]" "set-option -g pane-active-border-fg white"
if-shell "[ \"$COLORFGBG\" = \"11;15\" ]" "set-option -g pane-border-fg white"
# Set window notifications
setw -g monitor-activity on
set -g visual-activity on
# Enable native Mac OS X copy/paste
# set-option -g default-command "/bin/bash -c 'which reattach-to-user-namespace >/dev/null && exec reattach-to-user-namespace $SHELL -l || exec $SHELL -l'"
# Allow the arrow key to be used immediately after changing windows
set-option -g repeat-time 0
set -g pane-border-fg green
set -g pane-border-bg black
set -g pane-active-border-fg red
set -g pane-active-border-bg black
set -g message-fg white
set -g message-bg black
set -g message-attr bright
set -g status-fg white
set -g status-bg black
setw -g window-status-fg cyan
setw -g window-status-bg default
setw -g window-status-attr dim
setw -g window-status-current-fg white
setw -g window-status-current-bg red
setw -g window-status-current-attr bright
网友评论