-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
183 lines (148 loc) · 5.99 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# Rebind the prefix key
set-option -g prefix C-d
# Color options
set-option -g default-terminal "tmux-256color"
#set -g utf8
#set-window-option -g utf8 on
# Vi Modus
set-option -g status-keys vi
set-option -g mode-keys vi
bind-key : command-prompt
bind-key h select-pane -L
#bind-key c-h select-pane -L
bind-key j select-pane -D
#bind-key c-j select-pane -D
bind-key k select-pane -U
#bind-key c-k select-pane -U
bind-key l select-pane -R
#bind-key c-l select-pane -R
#bind-key 1 select-window 1
#bind-key 2 select-window 2
#bind-key 3 select-window 3
#bind-key 4 select-window 4
#bind-key 5 select-window 5
#bind-key 6 select-window 6
#bind-key 7 select-window 7
#bind-key 8 select-window 8
#bind-key 9 select-window 9
#bind-key 0 select-window 10
# S8AyFerINSaX6emVdtNv
# use vim-like keys for splits and windows
bind-key v split-window -h -c "#{pane_current_path}"
bind | split-window -h # horizontal columns
bind - split-window -v # vertical rows
## Mouse support
#set-window-option -g mode-mouse on
#set-option -g mouse-select-window on
#set-option -g mouse-select-pane on
#set-option -g mouse-resize-pane on
## Config reload
bind-key r source-file ~/.tmux.conf \; display-message "tmux.conf reloaded."
#bind-key m command-prompt -I "move-window -t "
#bind-key c-m move-window -r
# Using Shift-Keys
bind-key -n S-Left previous-window
bind-key -n S-Right next-window
bind-key -n S-Up command-prompt -I "rename-window "
bind-key -n S-Down new-window
bind-key -n C-S-Left swap-window -t -1
bind-key -n C-S-Right swap-window -t +1
## History
set-option -g history-limit 10000
## Start counting with one
set-option -g base-index 1
set-window-option -g pane-base-index 1
##set-option -g status on
#set-option -g status-bg blue
#set-option -g status-fg white
#set-window-option -g window-status-current-bg magenta
#
## Time to display pane numbers wenn hitting c-d q
set-option -g display-panes-time 1500
##set-option -g status-right '%k:%M'
## Allow the arrow key to be used immediately after changing windows
#set-option -g repeat-time 0
## Pane borders
#set -g pane-border-fg green
#set -g pane-border-bg black
#set -g pane-active-border-fg green
#set -g pane-active-border-bg yellow
## Command line
#set -g message-fg white
#set -g message-bg black
#set -g message-attr bright
## Status Bar Items
#set -g status-interval 2
#set -g status-left '[#S]'
##set -g status-right '#{session_id} #{window_id} #D #P/#{window_panes} %k:%M'
#set -g status-right '%k:%M'
#set-option -g status-justify left
##set-option -g status-justify centre
## Disable showing the default window list component and trim it to a more specific format.
#set-window-option -g window-status-current-format '#I:#W#F'
#set-window-option -g window-status-format '#I:#W#F'
set-window-option -g automatic-rename on
set-option -g allow-rename off
#{session_id} : unique session ID,
#S : session title,
#F : window flags (Info about which windows is active etc.),
#{window_id} : unique window ID,
#I : window index,
#W : window title,
#{window_panes} : number of active panes in current window,
#D : unique pane number,
#P : dynamic pane number,
#T : pane title
##For panes their unique identifier is a number prefixed with % and for windows a number prefixed with @.
##For sessions prefixed with $.
##
bind-key [ copy-mode
bind-key ] paste-buffer
bind-key -T edit-mode-vi Up send-keys -X history-up
bind-key -T edit-mode-vi Down send-keys -X history-down
unbind-key -T copy-mode-vi Space ; bind-key -T copy-mode-vi v send-keys -X begin-selection
unbind-key -T copy-mode-vi Enter ; bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
unbind-key -T copy-mode-vi C-v ; bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
unbind-key -T copy-mode-vi [ ; bind-key -T copy-mode-vi [ send-keys -X begin-selection
unbind-key -T copy-mode-vi ] ; bind-key -T copy-mode-vi ] send-keys -X copy-selection
# Set window notifications
setw -g monitor-activity on
set -g visual-activity on
## renumber windows when a window is closed
set -g renumber-windows on
#new -n #I zsh
# show battery charge in the status bar
#set -g status-right "#(/home/felix/.bin/battery discharging; /home/felix/.bin/battery charging) \"#h\" #(date)"
set -g status-right-length 150
set -g status-right "#(/home/felix/.bin/battery) \"#h\" \"#{pane_current_path}\" #(date +\"%d-%m-%y %H:%M\")"
#set -g status-right "#(uptime|awk '{print $11}') #(date)"
# Toggle mouse support of with m/M
bind m set-option -g mouse on \; display 'Mouse: ON'
bind M set-option -g mouse off \; display 'Mouse: OFF'
# Make the current window the first window
bind T swap-window -t 1
# Set status bar
#set -g status-bg "#a8aedd"
#set -g status-left '#[fg=#4b0b23][#I]'
# Highligh active window
#set-window-option -g window-status-current-bg "#b6f486"
#set -g status-bg "#5F87FF"
#set -g status-left '#[fg=#ffffff][#S]'
#set-window-option -g window-status-current-bg "#FF8C00"
########################
# Navigate tmux and vim
########################
# #{pane_title} return the host name... so the keybindings for vim don't work.
#bind -n C-h run "(tmux display-message -p '#{pane_title}' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L"
#bind -n C-j run "(tmux display-message -p '#{pane_title}' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D"
#bind -n C-k run "(tmux display-message -p '#{pane_title}' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U"
#bind -n C-l run "(tmux display-message -p '#{pane_title}' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R"
# X clipboard integration vim style with xsel
bind-key -T copy-mode-vi y send-keys -X copy-pipe "xsel -i -p -b"
bind-key p run "xsel -o | tmux load-buffer - ; tmux paste-buffer"
# If xsel doesn't work properly use xclip
#bind-key -t vi-copy y copy-pipe "xclip -i -sel clip > /dev/null"
#bind-key p run "xclip -o -sel clip | tmux load-buffer -"
source "/usr/share/powerline/bindings/tmux/powerline.conf"
## enable system copy/paste:
## https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard