-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.tmux.conf
More file actions
140 lines (114 loc) · 4.64 KB
/
.tmux.conf
File metadata and controls
140 lines (114 loc) · 4.64 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
# set prefex to space.
unbind C-b
set -g prefix C-Space
# open new/split panes with the path of the current pane.
unbind c
bind c new-window -c '#{pane_current_path}'
unbind %
bind % split-window -h -c '#{pane_current_path}'
unbind '"'
bind '"' split-window -v -c '#{pane_current_path}'
# Intuitive window-splitting keys.
bind | split-window -h -c '#{pane_current_path}' # normally prefix-%
bind \ split-window -h -c '#{pane_current_path}' # normally prefix-%
bind - split-window -v -c '#{pane_current_path}' # normally prefix-"
# Resizing (mouse also works).
unbind Left
bind -r Left resize-pane -L 5
unbind Right
bind -r Right resize-pane -R 5
unbind Down
bind -r Down resize-pane -D 5
unbind Up
bind -r Up resize-pane -U 5
# Fast toggle (normally prefix-l).
bind ^space last-window
# Status bar.
set -g status-bg '#343d46'
set -g status-fg white
set -g status-left-length 40
set -g status-left '#[fg=yellow]#S ⧉ '
set -g status-right "#[fg=yellow]$USER@#h #[fg=magenta]%l:%M %p"
set -g status-interval 60 # Default is 15.
# Automatically renumber window numbers on closing a pane (tmux >= 1.7).
set -g renumber-windows on
# Highlight active window.
# TODO is this needed/replacement
set-window-option -g window-status-current-style bg=red
# Mouse can be used to select panes, select windows (by clicking on the status
# bar), resize panes. For default bindings see `tmux list-keys` and `tmux
# list-keys -t vi-copy`.
set -g mouse on
# Restore pre-2.1 behavior of scrolling with the scrollwheel in Vim, less, copy
# mode etc, otherwise entering copy mode if not already in it.
#
# if in copy mode (pane_in_mode) || using the mouse already (mouse_any_flag)
# pass through mouse events to current pane (send -Mt=)
# elsif in alternate screen mode
# send `Up` key
# else
# enter copy mode (-e exits if we scroll to the bottom)
# end
#
bind-key -T root WheelUpPane \
if-shell -Ft= '#{?pane_in_mode,1,#{mouse_any_flag}}' \
'send -Mt=' \
'if-shell -Ft= "#{alternate_on}" "send -t= Up" "copy-mode -et="'
bind-key -T root WheelDownPane \
if-shell -Ft = '#{?pane_in_mode,1,#{mouse_any_flag}}' \
'send -Mt=' \
'if-shell -Ft= "#{alternate_on}" "send -t= Down" "send -Mt="'
set -g default-shell /bin/zsh
set -g default-terminal "tmux-256color"
# set -ga terminal-overrides ',xterm-256color:Tc'
set-option -ga terminal-overrides ",tmux-256color:Tc"
#set -g default-terminal "xterm-256color-italic"
#set -g default-terminal "tmux"
# Stay in copy mode on drag end, but otherwise exit for mouse up.
# Requires patch from https://github.com/tmux/tmux/issues/326
# TODO is this needed?
# unbind-key -t vi-copy MouseDragEnd1Pane
# bind-key -t vi-copy MouseUp1Pane cancel
# Start window and pane numbering at 1, (0 is too hard to reach).
set -g base-index 1
set -g pane-base-index 1
# Dynamically update iTerm tab and window titles.
set -g set-titles on
# Needed as on tmux 1.9 and up (defaults to off).
# Added in tmux commit c7a121cfc0137c907b7bfb.
set -g focus-events on
# But don't change tmux's own window titles.
#set -w -g automatic-rename off
# Don't wrap searches; it's super confusing given tmux's reverse-ordering of
# position info in copy mode.
set -w -g wrap-search off
# copy into sys clipboard; instead of 'Enter' to copy hit 'y' for yank
#bind -t vi-copy y copy-pipe 'xclip -in -selection clipboard'
#bind-key -t vi-copy y copy-pipe 'xclip -selection clipboard >/dev/null'
# #T = standard window title (last command, see ~/.bash_profile)
# #h = short hostname
# #S = session name
# #W = tmux window name
#
# (Would love to include #(pwd) here as well, but that would only print the
# current working directory relative to the session -- ie. always the starting
# cwd -- which is not very interesting).
#set -g set-titles-string "#T : #h > #S > #W"
set -g set-titles-string "#T"
# Show bells in window titles.
set -g window-status-bell-style fg=yellow,bold,underscore
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind-key -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
set-window-option -g mode-keys vi
# TODO is this needed
# bind-key -t vi-copy 'v' begin-selection
# bind-key -t vi-copy 'y' copy-selection
# manual plugin installs here (temp)
run-shell ~/Documents/tmux-plugins-temp/tmux-yank/yank.tmux