Skip to content

Instantly share code, notes, and snippets.

@jiqiujia
Last active March 14, 2017 08:04
Show Gist options
  • Save jiqiujia/133c7712e7d59173f80d55b41c597c0f to your computer and use it in GitHub Desktop.
Save jiqiujia/133c7712e7d59173f80d55b41c597c0f to your computer and use it in GitHub Desktop.
tmux2.3 configuration file
#设置前缀为Ctrl + a
unbind ^b
set -g prefix 'C-a'
#将r 设置为加载配置文件,并显示信息
bind r source-file ~/.tmux.conf \; display-message "Config reloaded"
#up
bind-key k select-pane -U
#down
bind-key j select-pane -D
#left
bind-key h select-pane -L
#right
bind-key l select-pane -R
#select last window
bind-key C-l select-window -l
#copy-mode 将快捷键设置为vi 模式
setw -g mode-keys vi
set -g history-limit 99999
bind H resize-pane -L 10 # 向左扩展
bind L resize-pane -R 10 # 向右扩展
bind K resize-pane -U 5 # 向上扩展
bind J resize-pane -D 5 # 向下扩展
#通过点击选择窗格,通过拖动更改窗格大小,通过鼠标选择窗口
set -g mouse on
# No delay for escape key press
set -sg escape-time 0
bind-key -t vi-copy 'v' begin-selection # Begin selection in copy mode.
bind-key -t vi-copy 'C-v' rectangle-toggle # Begin selection in copy mode.
bind-key -t vi-copy 'y' copy-selection # Yank selection in copy mode
# enable copy paste through ssh, through x11 forwarding
bind -t vi-copy y copy-pipe "xclip -sel clip -i"
#powerline-status
run-shell "powerline-daemon -q"
source "/home/dl/anaconda/lib/python2.7/site-packages/powerline/bindings/tmux/powerline.conf"
##Tmux pluguin manager
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin '[email protected]/user/plugin'
# set -g @plugin '[email protected]/user/plugin'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @continuum-restore 'on'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
# Use C-l to clear the visible scrollback lines
# # -n means prefix could be ignored
bind -n C-l send-keys 'C-l'
#
# # Use C-k to clear the scrolled off (hidden) buffer lines
bind -n C-k clear-history 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment