-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
136 lines (106 loc) · 4.31 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
# get nice colors in the terminal
## solid, widely compatible default
set -g default-terminal "screen-256color"
## true color where supported
set-option -sa terminal-overrides ",xterm*:Tc"
bind R source-file ~/.tmux.conf \; display "Tmux config reloaded!"
set -s extended-keys on
set-option -g history-limit 100000
# I think this is made obsolete by tmux-sensible???
# set-option -sg escape-time 10
set-option -g status-style 'bg=#444444,fg=#bbbbbb'
set-option -g window-status-format ' #I: #W#{?window_zoomed_flag, 🔍, } '
set-option -g window-status-last-style 'bg=#535353,fg=#999999'
set-option -g window-status-current-format ' #I: #W#{?window_zoomed_flag, 🔍, } '
set-option -g window-status-current-style 'bg=#2f2f2f,fg=yellow'
set-option -g status-left ' #S '
set-option -g status-left-length 20
set-option -g status-left-style 'fg=black,bg=yellow'
set-option -g status-right-length 100
set-option -g status-right-style 'bg=#4b4b4b,fg=#999999'
set-option -g status-right "#[default] #(date '+%m/%d/%y %I:%M') "
set-option -g mouse on
# c-space for prefix
unbind C-b
set -g prefix C-Space
# set -g prefix C-\
# open new split panes with s and v, using vim-style definitions of split direction
unbind v
bind v split-window -h -c "#{pane_current_path}"
bind C-v split-window -h -c "#{pane_current_path}"
unbind s
bind s split-window -v -c "#{pane_current_path}"
# TODO bind some layout functionality
# | key | action |
# |-----|--------------------------------|
# | H | swap current pane w/ its left |
# | J | swap current pane w/ its right |
# | K | swap current pane w/ above |
# | L | swap current pane w/ below |
# |-----|--------------------------------|
# | g | resize pane to golden ratio |
# equal tiling
bind = select-layout tiled
# current pane becomes main window: it's big and on the left, with others stacked to its right
# TODO make the main window bigger instead of blindly using a default size that is small in big windows
bind o select-layout main-vertical
# golden ratio
bind g run-shell 'tmux resize-pane -x $(tmux display-message -p "#{window_width}" | awk "{print int(\$1 * 0.62)}")'
# and rebind the session chooser to capital S
bind S choose-tree -Zs
# for when the split orientation just isn't hitting right
bind f next-layout
bind r rotate-window
# toggle latest windows with `
bind ` last-window
# confirm-before got old fast
bind x kill-pane
bind X kill-session
# extract current pane to separate window
bind b break-pane
# window navigation
unbind h
bind h select-pane -L
unbind j
bind j select-pane -D
unbind k
bind k select-pane -U
unbind l
bind l select-pane -R
# vim copy mode
setw -g mode-keys vi
# enter copy-mode with space
bind Space copy-mode
bind C-Space copy-mode
unbind p
bind p paste-buffer
bind-key -T copy-mode-vi 'v' send-keys -X begin-selection
# OS-specific config
if-shell "test $(uname) == Darwin" {
set-option -g default-shell /opt/homebrew/bin/zsh
# TODO Is this needed/helpful/superfluous? Found at https://thoughtbot.com/blog/how-to-copy-and-paste-with-tmux-on-mac-os-x
# set-option -g default-command "reattach-to-user-namespace -l /usr/local/bin/zsh"
bind -T copy-mode-vi 'y' send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
} {
set-option -g default-shell /usr/bin/zsh
bind -T copy-mode-vi 'y' send-keys -X copy-pipe-and-cancel "xclip -i -f -selection primary | xclip -i -selection clipboard"
bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xclip -i -f -selection primary | xclip -i -selection clipboard"
}
# * TPM
# examples of import syntax:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'git@github.com/user/plugin'
# set -g @plugin 'git@bitbucket.com/user/plugin'
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tmux-plugins/tmux-open'
# 'o' is the default "open region" binding, but when I'm using vim copy-mode bindings, I
# need 'o' free to switch uhhh point and mark
set -g @open 'O'
set -g @open-editor-command "~/bin/qed"
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'