-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
146 lines (125 loc) · 3.86 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
# cat << END_TMUX_CONF > /dev/null
set-environment -gu RBENV_VERSION
#set -g default-terminal "xterm-256color"
set-option -ga terminal-overrides ",xterm-256color:Tc"
set -g default-terminal "xterm-256color"
set -g history-limit 20000
set-hook -g 'before-new-session' 'run "cut -c3- ~/.tmux.conf |sh -s _print"'
#set-hook -g 'after-kill-window' 'run "echo foo>bar.text"'
#set-hook -g 'before-new-session' 'display-message "New window"'
#set-hook -g 'before-new-session' 'run "echo foo>bar.text"'
#set-hook -g 'after-new-window' 'run "notify-send new-window..."'
#set-hook -g 'after-split-window' 'display-message "I split this window!"'
#set-hook -g 'before-new-window' 'splitw ; run "notify-send YES"'
#set-hook -tfoo -n 'after-split-window' 'display-message "I split this window!"'
#set-hook -tfoo -n 'before-new-window' 'splitw ; run "notify-send YES"'
#new -sfoo
#set tmux default to zsh
set-option -g default-shell $SHELL
#Rename window: ctrl-f + ,
#
# use VI
setw -g mode-keys vi
set-window-option -g xterm-keys on
#set-option -g xterm-keys on
setw -g aggressive-resize on
# Sane scrolling
set-option -g mouse on
set -g display-panes-time 3000 #2s display pane
set -g pane-base-index 1
set -g base-index 1
# Use ctrl-f instead of ctrl-b
set -g prefix C-f
unbind C-b
bind C-f send-prefix
unbind [
unbind /
bind c copy-mode
#unbind p
#bind p paste-buffer
# Bind ']' to use pbpaste
#bind p run "reattach-to-user-namespace pbpaste | tmux load-buffer - && tmux paste-buffer"
# list-keys -t vi-copy
bind-key -T copy-mode-vi 'v' send-keys -X begin-selection
set-option -g default-command "reattach-to-user-namespace -l ${SHELL}"
bind-key -T copy-mode-vi 'y' send-keys -X copy-pipe "reattach-to-user-namespace pbcopy"
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe "reattach-to-user-namespace pbcopy"
bind-key -T copy-mode-vi 'K' send-keys -X halfpage-up
bind-key -T copy-mode-vi 'J' send-keys -X halfpage-down
bind-key -T copy-mode-vi V send-keys -X rectangle-toggle
# reload config
#unbind r
#bind r source-file ~/.tmux.conf
unbind ^T
bind t split-window -p 25
# horizontal and vertical splits
unbind |
bind v split-window -h
unbind _
bind s split-window
# tile all windows
unbind =
bind = select-layout tiled
# cycle through panes
unbind ^A
bind ^A select-pane -t :.+
unbind Right
bind Right resize-pane -R 25
unbind Left
bind Left resize-pane -L 26
unbind Up
bind Up resize-pane -t 1 -y 60
unbind Down
bind Down resize-pane -t 1 -y 25
bind-key -n C-S-Left swap-window -t -1
bind-key -n C-S-Right swap-window -t +1
unbind ^o
unbind r
bind r rotate-window
unbind o
bind o resize-pane -Z
unbind h
bind-key -n C-h select-pane -L
unbind j
bind-key -n C-j select-pane -D
unbind k
bind-key -n C-k select-pane -U
unbind l
bind-key -n C-l select-pane -R
bind-key -n C-Space display-panes \; select-pane -t :.
bind Space choose-window
#bind-key -n C-p choose-buffer
#Clear the buffer
bind-key -n F10 confirm-before -p "kill-window #W? (y/n)" kill-window
bind-key -n F5 send-keys -R \; clear-history
unbind-key F5
bind-key -n F8 new-window
bind-key -n F7 previous-window
bind-key -n F9 next-window
############################################################################
# Status Bar
############################################################################
#set-option -g status-utf8 on
set-option -g status-justify left
set-option -g status-bg black # colour213 # pink
set-option -g status-fg cyan
set-option -g status-interval 1
set-option -g status-left-length 60
set -g window-status-current-style bg=cyan,fg=black
set-option -g status-left ''
set-option -g visual-activity on
# battery status via https://raw.github.com/richoH/dotfiles/master/bin/battery
set -g status-right '#[fg=magenta]#(battery) #[fg=cyan]%B %e %R'
# clock
set-window-option -g clock-mode-colour cyan
set-window-option -g clock-mode-style 12
# END_TMUX_CONF
#
# set -e
#
# _print() {
# //echo "foo bar"
# }
#
# "$@"