forked from reorx/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
122 lines (98 loc) · 3.36 KB
/
tmux.conf
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#--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
# 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 history-limit 100000
## 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 '
#
# tmux resurrect
run-shell ~/.tmux-resurrect/resurrect.tmux