-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdot_tmux.conf
More file actions
145 lines (109 loc) · 4.54 KB
/
dot_tmux.conf
File metadata and controls
145 lines (109 loc) · 4.54 KB
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
###########################################################################
# Change prefix from default (C-b) to C-a
set -g prefix C-a
###########################################################################
# General options
# Ring the bell if any background window rang a bell
set -g bell-action any
# Watch for activity in background windows
setw -g monitor-activity on
# set first window to index 1 (not 0) to map more to the keyboard layout
set -g base-index 1
setw -g pane-base-index 1
# pass through xterm keys
set -g xterm-keys on
# enable true color
set-option -ga terminal-overrides ",xterm-256color-italic:Tc"
# ensure there is minimal delay in neovim when pressing <esc>
set -g escape-time 10
###########################################################################
# General keymap
# Keep your finger on ctrl, or don't, same result
bind-key C-d detach-client
bind-key C-c new-window
bind-key C-p paste-buffer
# Redraw the client (if interrupted by wall, etc)
bind r refresh-client
# Use vi keybindings in copy and choice modes
setw -g mode-keys vi
###########################################################################
# Window management / navigation
# Screen like binding for last window
unbind l
bind C-a last-window
# C-Space (no prefix) to tab to next window
bind -n C-Space next-window
bind k confirm kill-window
###########################################################################
# Pane management / navigation
# Create splits and vertical splits
bind-key v split-window -h -c "#{pane_current_path}"
bind-key ^V split-window -h -c "#{pane_current_path}"
bind-key s split-window -c "#{pane_current_path}"
bind-key ^S split-window -c "#{pane_current_path}"
# New window with default path set to last path
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
# Smart pane switching with awareness of vim splits
not_tmux='`echo #{pane_current_command} | grep -iqE "(^|\/)g?(view|n?vim?x?)(diff)?$"` || `echo #{pane_start_command} | grep -iqE "fzf"` || `echo #{pane_current_command} | grep -iqE "fzf"`'
bind -n C-h if-shell "$not_tmux" "send-keys C-h" "select-pane -L"
bind -n C-j if-shell "$not_tmux" "send-keys C-j" "select-pane -D"
bind -n C-k if-shell "$not_tmux" "send-keys C-k" "select-pane -U"
bind -n C-l if-shell "$not_tmux" "send-keys C-l" "select-pane -R"
bind -n C-\ if-shell "$not_tmux" "send-keys C-\\" "select-pane -l"
# C-a C-k to passthrough a C-k
# C-k is consumed for pane navigation but we want it for kill-to-eol
unbind C-k
bind C-k send-key C-k
# Pane resize in all four directions using vi bindings.
# Can use these raw but I map them to shift-ctrl-<h,j,k,l> in iTerm.
bind-key H resize-pane -L
bind-key J resize-pane -D
bind-key K resize-pane -U
bind-key L resize-pane -R
# fix iterm2 hex code shortcuts
set -g assume-paste-time 0
# easily toggle synchronization (mnemonic: e is for echo)
# sends input to all panes in a given window.
bind e setw synchronize-panes on
bind E setw synchronize-panes off
# fix session chooser
bind e choose-session
###########################################################################
# Mouse mode
# Toggle mouse on with ^B m
bind m \
set -g mouse on \;\
display 'Mouse: ON'
# Toggle mouse off with ^B M
bind M \
set -g mouse off \;\
display 'Mouse: OFF'
###########################################################################
# Color scheme
set -g status-fg colour231
set -g status-bg colour234
###########################################################################
# Status Bar
set -g status on
set -g status-position top
set -g status-interval 2
set -g status-left-length 20
set -g status-left '#[fg=colour16,bg=colour254,bold] #S #[fg=colour254,bg=colour234,nobold]'
set -g status-right-length 150
set -g status-right ''
set -g window-status-format "#[fg=colour244,bg=colour234]#I #[fg=colour240] #[fg=colour249]#W "
set -g window-status-current-format "#[fg=colour234,bg=colour31]#[fg=colour117,bg=colour31] #I #[fg=colour231,bold]#W #[fg=colour31,bg=colour234,nobold]"
###########################################################################
# TMUX plugin manager
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'nhdaly/tmux-scroll-copy-mode'
set -g @override_copy_command 'pbcopy'
# Initializes TMUX plugin manager.
# Keep this line at the very bottom of tmux.conf.
run -b '~/.tmux/plugins/tpm/tpm'
###########################################################################