-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf.old
90 lines (76 loc) · 3.91 KB
/
.tmux.conf.old
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#-- base setting --#
# -- general -------------------------------------------------------------------
set -g default-terminal "screen-256color"
set -g history-limit 5000 # boost history
# Change the default prefix key
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# Enable mouse mode
set -g mode-mouse on
set -g mouse-select-pane on
set -g mouse-select-window on
bind | split-window -h -c "#{pane_current_path}" # split current window horizontally
bind - split-window -v -c "#{pane_current_path}" # split current window vertically
bind -r h select-pane -L # move left
bind -r j select-pane -D # move down
bind -r k select-pane -U # move up
bind -r l select-pane -R # move right
bind > swap-pane -D # swap current pane with the next one
bind < swap-pane -U # swap current pane with the previous consistent
# -- display ------------------------------------------------------------------
set -g base-index 1 # start windows numbering at 1
setw -g pane-base-index 1 # make pane numbering consistent with Windows
setw -g automatic-rename on # rename window to reflect current program
set -g renumber-windows on # renumber windows when a window is closed
set -g set-titles on # set terminal title
set -g status-interval 10 # redraw status line every 10 seconds
set -g monitor-activity on # activity
set -g visual-activity off
# -- copy mode ----------------------------------------------------------------
bind p paste-buffer
bind -t vi-copy 'v' begin-selection
bind -t vi-copy 'y' copy-selection
bind -t vi-copy 'V' rectangle-toggle
bind Enter copy-mode # enter copy mode
bind b list-buffers # list paste buffers
bind p paste-buffer # paste from the top paste buffer
bind P choose-buffer # choose which buffer to paste from
# move x clipboard into tmux paste buffer
bind C-p run "tmux set-buffer \"$(xclip -o)\"; tmux paste-buffer"
# move tmux copy buffer into x clipboard
bind C-y run "tmux save-buffer - | xclip -i"
tmux_conf_copy_to_os_clipboard=true
# copy to Mac OSX clipboard, shuld install reattach-to-user-namespace
if-shell 'test "$(uname -s)" = Darwin' 'set-option -g default-command "exec reattach-to-user-namespace -l ${SHELL}"'
if-shell 'command -v reattach-to-user-namespace > /dev/null 2>&1' 'bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"'
if-shell 'command -v reattach-to-user-namespace > /dev/null 2>&1' 'bind -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"'
if-shell 'command -v reattach-to-user-namespace > /dev/null 2>&1' 'bind -T copy-mode-vi Enter send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"'
# length of tmux status line
set -g status-left-length 30
set -g status-right-length 150
##--Status-Bar-------------------------------------------------------------------
## Default colors
set -g status-bg colour250
set -g status-fg black
set-option -g status-utf8 on
set -g status-justify left
set-option -g status-position bottom
#
### 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=colour7]#[fg=colour0]#{?client_prefix,#[bg=colour2],} ❐ #S #[bg=colour8]#[fg=colour7]#{?client_prefix,#[fg=colour2],}#{?window_zoomed_flag, 🔍 ,} '
#
### Middle of status bar, window labels
## Inactive windows in status bar
set-window-option -g window-status-format '#[fg=colour248]#[bg=colour238] #I- '
## 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 '#[fg=colour7]#[bg=colour4] #I* #[fg=colour7] #W '
#
### 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 '
# reload configuration
bind r source-file ~/.tmux.conf \; display '~/.tmux.conf sourced'