-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
132 lines (93 loc) · 3.52 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
# Copied from https://github.com/chrishunt/dot-files/blob/master/.tmux.conf and modified according to my needs
# use 256 term for pretty colors
set -g default-terminal "screen-256color"
# Enable the mouse
set -g mouse on
# increase scroll-back history
set -g history-limit 5000
# use vim key bindings
setw -g mode-keys vi
# start window index at 1
set -g base-index 1
# start pane index at 1
setw -g pane-base-index 1
# decrease command delay (increases vim responsiveness)
set -sg escape-time 1
# re-number windows when one is closed
set -g renumber-windows on
# Enable xterm keys
set-window-option -g xterm-keys on
set-option -g destroy-unattached off
# Enable Focus events as they are used by nvim
set -g focus-events on
###########################
# Key Bindings
###########################
# tmux prefix
set -g prefix C-b
bind C-b send-prefix
# paste
unbind C-p
bind C-p paste-buffer
# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf \; display "Reloaded!"
setw -g aggressive-resize on
bind-key -r C-h select-window -t :-
bind-key -r C-l select-window -t :+
# Split windows like Vim.
bind v split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
bind '"' split-window -h -c "#{pane_current_path}"
bind % split-window -v -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
bind-key -r f run-shell "tmux neww tmux-sessionizer"
#######################################################
# Making copying and pasting work
#######################################################
# Copy-paste integration
set-option -g default-command "$SHELL -l"
# Use vim keybindings in copy mode
setw -g mode-keys vi
# Setup 'v' to begin selection as in Vim
bind-key -T copy-mode-vi v send -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy"
# Update default binding of `Enter` to also use copy-pipe-and-cancel
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "pbcopy"
# Bind ']' to use pbpaste
bind ] run "pbpaste | tmux load-buffer - && tmux paste-buffer"
#######################################################
# Vim Tmux Navigation
#######################################################
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$"'
bind h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
#######################################################
# Colors
#######################################################
# From https://github.com/connrs/dotfiles/blob/master/tmux/tomorrow-night.tmux
#set status bar
set -g status-style bg="#373b41"
set -g status-style fg="#c5c8c6"
## highlight active window
setw -g window-status-current-style bg="#282a2e"
setw -g window-status-current-style fg="#81a2be"
## highlight activity in status bar
setw -g window-status-activity-style fg="#8abeb7"
setw -g window-status-activity-style bg="#1d1f21"
## pane border and colors
set -g pane-active-border-style bg=default
set -g pane-active-border-style fg="#373b41"
set -g pane-border-style bg=default
set -g pane-border-style fg="#373b41"
set -g clock-mode-colour "#81a2be"
set -g clock-mode-style 24
set -g message-style bg="#8abeb7"
set -g message-style fg="#000000"
set -g message-command-style bg="#8abeb7"
set -g message-command-style fg="#000000"
set -g mode-style bg="#8abeb7"
set -g mode-style fg="#000000"