-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
181 lines (148 loc) · 6.28 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
##############################
# _
# | |_ _ __ ___ _ ___ __
# | __| '_ ` _ \| | | \ \/ /
# | |_| | | | | | |_| |> <
# \__|_| |_| |_|\__,_/_/\_\
#
#############################
# COPY AND PASTE
# http://robots.thoughtbot.com/tmux-copy-paste-on-os-x-a-better-future
set-option -sg escape-time 0
# Use vim keybindings in copy mode
setw -g mode-keys vi
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
unbind-key -T prefix Enter
bind-key -T prefix Enter copy-mode
bind-key -T copy-mode-vi Enter send-keys -X cancel
bind-key -T copy-mode Enter send-keys -X cancel
# Update default binding of `Enter` to also use copy-pipe
# unbind -t vi-copy Enter
# bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
############################################################################
# Reset Prefix
############################################################################
set -g prefix C-a
bind-key a send-prefix # for nested tmux sessions
############################################################################
# Global options
############################################################################
# large history
set-option -g history-limit 10000
# colors
set-option -g default-terminal "xterm-256color" #"xterm-256color" # "screen-256color"
# These are the rules you need to use True Color and Nova terminal ANSI colors
# If you want Tmux to use the Nova color scheme, ensure you have installed a Nova plugin for your terminal first
set -g default-terminal "screen-256color"
set -g focus-events on
set -ga terminal-overrides ',*:Ss=\E[%p1%d q:Se=\E[2 q'
set -ga terminal-overrides ',xterm-256color:Tc'
set -g pane-border-style 'bg=black,fg=#1E272C'
set -g pane-active-border-style 'bg=black,fg=#1E272C'
set -g status-style 'bg=#1E272C,fg=#6A7D89'
# set-window-option -g window-status-current-bg '#1E272C'
# set-window-option -g window-status-current-fg '#cccccc'
set -wg mode-style 'bg=#cccccc,fg=black'
set -g message-style 'bg=black,fg=#cccccc'
set -g clock-mode-colour '#cccccc'
source ~/.tmux-statusline-colors.conf
# basic settings
set-window-option -g xterm-keys on # for vim
set-window-option -g mode-keys vi # vi key
set-window-option -g monitor-activity on
# set-window-option -g window-status-current-fg white
# setw -g window-status-current-attr reverse
# Automatically set window title
setw -g automatic-rename
# use mouse. You can copy past with the mouse in iTerm pressing the alt key during selection
setw -g mouse on
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
# vi movement keys
set-option -g status-keys vi
############################################################################
# Status Bar
############################################################################
set-option -g status-justify right
set-option -g status-bg black # colour213 # pink
set-option -g status-fg cyan
set-option -g status-interval 5
set-option -g visual-activity on
# Titles (window number, program name, active (or not)
set-option -g set-titles on
set-option -g set-titles-string '#H:#S.#I.#P #W #T'
############################################################################
# Unbindings
############################################################################
unbind [ # copy mode bound to escape key
unbind j
unbind C-b # unbind default leader key
unbind '"' # unbind horizontal split
unbind % # unbind vertical split
unbind Escape
############################################################################
# Bindings
############################################################################
# reload tmux conf
bind-key r source-file ~/.tmux.conf
bind Escape copy-mode
# new split in current pane (horizontal / vertical)
bind-key - split-window -v # split pane horizontally
bind-key \\ split-window -h # split pane vertically
# list panes
bind-key Space list-panes
#previous pane
bind-key -n C-up prev
bind-key -n C-left prev
#next pane
bind-key -n C-right next
bind-key -n C-down next
############################################################################
# windows
############################################################################
# set-window-option -g window-status-current-bg red
bind C-j previous-window
bind C-k next-window
bind-key C-a last-window # C-a C-a for last active window
bind A command-prompt "rename-window %%"
# By default, all windows in a session are constrained to the size of the
# smallest client connected to that session,
# even if both clients are looking at different windows.
# It seems that in this particular case, Screen has the better default
# where a window is only constrained in size if a smaller client
# is actively looking at it.
setw -g aggressive-resize on
############################################################################
# panes
############################################################################
# Navigation ---------------------------------------------------------------
# use the vim motion keys to move between panes
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
# Resizing ---------------------------------------------------------------
bind-key C-h resize-pane -L
bind-key C-j resize-pane -D
bind-key C-k resize-pane -U
bind-key C-l resize-pane -R
# Move with Alt+Arrow
# Works but add Esc+Arrow too, which is annoying when using vim
# bind -n M-Left select-pane -L
# bind -n M-Right select-pane -R
# bind -n M-Up select-pane -U
# bind -n M-Down select-pane -D
############################################################################
# layouts
############################################################################
bind o select-layout "active-only"
bind M-- select-layout "even-vertical"
bind M-| select-layout "even-horizontal"
bind M-r rotate-window
# focus on first window
# select-window -t 0