forked from rmm5t/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 15
/
tmux.conf
141 lines (106 loc) · 4.22 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
# fixes copy & paste issue w/ tmux
# set-option -g default-command "reattach-to-user-namespace -l bash"
set-option -g default-shell /opt/homebrew/bin/bash
set -g history-limit 9999
# pretty colors
set -g default-terminal "screen-256color"
# I don't care about matching screen's C-a. It's awkward for my vi hands. Also
# I don't like the defalt C-b. C-space doesn't conflict with any vim bindings,
# and it's also the same between dvorak/qwerty.
unbind C-b
set-option -g prefix C-"space"
# speaking of being a vi guy
set -g mode-keys vi
# Allows for faster key repetition
set -sg escape-time 0
# Rather than constraining window size to the maximum size of any client
# connected to the *session*, constrain window size to the maximum size of any
# client connected to *that window*. Much more reasonable.
setw -g aggressive-resize on
# reload config, useful while hacking on config
bind r source-file ~/.tmux.conf
# refresh the client when everything gets out of whack, all the time.
bind C-"space" refresh-client
# window counts start from 1, instead of 0
set -g base-index 1
# for nested tmuxes, I'm not sure I really need this
# bind-key z send-prefix
# windows with activity are not highlighted in status line
set-window-option -g monitor-activity off
set-option -g visual-activity off
### status line
set -g status-left-length 52
set -g status-right-length 451
set -g status-fg white
set -g status-bg colour234
set -g status-left '#[fg=colour235,bg=colour252,bold] ❐ #I #[fg=colour252,bg=colour238,nobold]⮀#[fg=colour245,bg=colour238,bold] #(whoami) #[fg=colour238,bg=colour234,nobold]⮀'
set -g window-status-format "#[fg=white,bg=colour234] #I.#P #W "
set -g window-status-current-format "#[fg=colour234,bg=colour39]⮀#[fg=white,bg=colour39,noreverse,bold] #I.#P ⮁ #W #[fg=colour39,bg=colour234,nobold]⮀"
### key bindings for window/pane handling
# splitting with v and h
unbind %
bind C-s split-window -c "#{pane_current_path}" -v
bind C-v split-window -c "#{pane_current_path}" -h
# switching between windows (like tabs)
bind -r C-n select-window -t :+
bind -r C-p select-window -t :-
# resizing panes
bind -r "left" resize-pane -L 10
bind -r "down" resize-pane -D 5
bind -r "up" resize-pane -U 5
bind -r "right" resize-pane -R 10
bind -r S-"left" resize-pane -L 1
bind -r S-"down" resize-pane -D 1
bind -r S-"up" resize-pane -U 1
bind -r S-"right" resize-pane -R 1
bind -r x swap-pane -D
# create new window (like tabs)
bind -r C-t new-window -c "#{pane_current_path}"
# Move windows left and right
bind-key -n C-S-Left swap-window -t -1
bind-key -n C-S-Right swap-window -t +1
# using one of the main-* layouts, this is handy for cycling which pane has the
# main spot in the layout.
bind -r C-r rotate-window
# Zoom pane in by breaking it out into it's own window
bind C-z break-pane
# easily kill pane
bind C-q kill-pane
# useful layouts
bind F1 select-layout main-horizontal
bind F2 select-layout main-vertical
### key bindings for copy mode
bind-key v copy-mode
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel
bind-key p paste-buffer
# enter copy mode kinda like we enter visual mode in vi
# bind v copy-mode
# bind -T vi-copy v rectangle-toggle
# bind -T vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
# bind -T vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
# bind -T vi-copy Escape cancel
# bind p paste-buffer
# set -g @copycat_next 'C-n'
# set -g @copycat_prev 'C-p'
# export the yanked selection to system
bind y run "tmux show-buffer | reattach-to-user-namespace pbcopy"
# make mouse useable
# set -g mode-mouse on
# setw -g mouse-select-window on
# setw -g mouse-select-pane on
# setw -g mouse-resize-pane on
# List of plugins
# Supports `github_username/repo` or full git repo URLs
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-open'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @resurrect-save 'S'
set -g @resurrect-restore 'R'
set -g @resurrect-processes 'tig "~working_set"'
# Initializes TMUX plugin manager.
# Keep this line at the very bottom of tmux.conf.
run '~/.tmux/plugins/tpm/tpm'