ini tmux conf为2.1以上
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ini tmux conf为2.1以上相关的知识,希望对你有一定的参考价值。
#--Key-Bindings-----------------------------------------------------------------
# change the prefix from 'C-b' to 'C-a'
# (remap capslock to CTRL for easy access)
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# start with window 1 (instead of 0)
set -g base-index 1
# start with pane 1
set -g pane-base-index 1
# more intuitive split keys
bind | split-window -h
bind - split-window -v
# create window
bind-key c new-window -a
#bind-key C command-prompt -p ssh: "new-window -n %1 'sudo -u work ssh %1'"
# move windows
bind-key -n C-right next-window
#bind-key -n C-N next-window
bind-key -n C-left previous-window
#bind-key -n C-P previous-window
# move between windows
bind -r p select-window -t :-
bind -r n select-window -t :+
# rename window
bind-key e command-prompt -p rename: 'rename-window %1'
##setw -g automatic-rename off'"'"'
set-option -g allow-rename off
# move between panes using vi keys 'hjkl'
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind -n M-up resize-pane -U 1
bind -n M-down resize-pane -D 1
bind -n M-left resize-pane -L 1
bind -n M-right resize-pane -R 1
# duplicate input to all panes in the same window
bind S set-window-option synchronize-panes on
bind s set-window-option synchronize-panes off
# move window
bind N swap-window -t +1
bind P swap-window -t -1
# reassign ; from last-pane to last-window
unbind \;
bind \; last-window
# reassign ' from select-window to last-pane, and use ' for last-pane
unbind "'"
bind "'" last-pane
bind / command-prompt -p index "select-window -t ':%%'"
# open a man page in new pane or window
bind m command-prompt -p "man page:" "split-window -h 'exec man %%'"
bind M command-prompt -p "Man page:" "new-window -n 'man %1' 'exec man %1'"
# reload config file
bind r source-file ~/.tmux.conf
##--Usability--------------------------------------------------------------------
# enable vi mode keys
set-option -g status-keys vi
set-window-option -g mode-keys vi
#bind -t vi-copy 'v' begin-selection
#bind -t vi-copy 'y' copy-selection
# set default terminal mode to 256 colors
set -g default-terminal "screen-256color"
## keep tmux msgs around longer
set -g display-time 3000
## set -g set-titles off
## Set window notifications
##set-window-option -g monitor-activity on
##set -g visual-activity on
# While mouse is on, hold option key to select text
set -g mouse on
######################
### DESIGN CHANGES ###
######################
##--Status-Bar-------------------------------------------------------------------
## Default colors
set -g status-bg colour250
set -g status-fg white
set -g status-justify left
set-option -g status-position bottom
set -g status-left ''
#
### Left side of status bar
## Show session name and hostname in my choice of colors
set -g status-left-length 30
set -g status-left '#[bg=colour236,fg=colour33] #H:#S #[bg=default] '
#
### Middle of status bar, window labels
## Inactive windows in status bar
set-window-option -g window-status-format '#[bg=colour245,fg=colour0] #I:#W '
## Current or active window in status bar
#set-window-option -g window-status-current-format '#[bg=default,fg=red]#I:#W#F'
set-window-option -g window-status-current-format '#[bg=colour0,fg=colour15] #I:#W#F'
#
### Right side of status bar
## show current window title, date and time in my choice of colors
set -g status-right '#[bg=colour238]#[fg=colour248] %Y-%m-%d %H:%M '
#
以上是关于ini tmux conf为2.1以上的主要内容,如果未能解决你的问题,请参考以下文章