-
Notifications
You must be signed in to change notification settings - Fork 0
/
my_tmux.conf
135 lines (101 loc) · 4.13 KB
/
my_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
# Start windows and panes at 1, not 0
set -g base-index 1
setw -g pane-base-index 1
# split windows like vim
# vim's definition of a horizontal/vertical split is reversed from tmux's
bind s split-window -v
bind v split-window -h
bind ^s split-window -v
bind ^v split-window -h
# move around panes with hjkl, as one would in vim after pressing ctrl-w
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind ^h select-pane -L
bind ^j select-pane -D
bind ^k select-pane -U
bind ^l select-pane -R
# resize panes like vim
# feel free to change the "1" to however many lines you want to resize by, only
# one at a time can be slow
bind -r < resize-pane -L 10
bind -r > resize-pane -R 10
bind -r - resize-pane -D 10
bind -r + resize-pane -U 10
# bind : to command-prompt like vim
# this is the default in tmux already
bind : command-prompt
# session management
bind C new-session
bind L choose-session
# allow rodent use
bind m set -g mouse on \; display 'Mouse: ON'
bind M set -g mouse off \; display 'Mouse: OFF'
# vi-style controls for copy mode
setw -g mode-keys vi
# Set the prefix to ^A, like screen
unbind C-b
set -g prefix ^A
bind a send-prefix
bind ^a last-window # toggle last window like screen
set -g update-environment "DISPLAY WINDOWID SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION"
bind K confirm kill-server
bind X confirm kill-window
# longer scrollback
set -g history-limit 10000
# active terminal darkblue border, non-active white
set -g pane-border-style fg=colour247,bg=default
set -g pane-active-border-style fg=colour31,bg=default
# set a 256color $TERM variable so programs inside tmux know they can use 256 colors
set -g default-terminal screen-256color
# reload tmux config file with C-a r
bind-key r source-file ~/.tmux.conf \; display-message '~/.tmux.conf reloaded'
# Create a new window and prompt for name
bind N command-prompt "new-window -n '%%'"
# Rebind prefix to b
bind B set -g prefix ^b
bind A set -g prefix ^a
# open splits and windows in same pwd
bind s split-window -c "#{pane_current_path}"
bind v split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
# neovim in tmux causes delay when pressing ESC, this reduces it
set -g escape-time 0 # ms
# TPM List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'Morantron/tmux-fingers'
set -g @fingers-pattern-0 'git push --set-upstream .*'
# initializes TMUX plugin manager
run '~/.tmux/plugins/tpm/tpm'
# let us use utf-8 drawing characters to make tab-like window formats
set -g status-style bg=default,fg=white
# # left side of status bar holds "(>- session name -<)"
set -g status-left ''
set -g status-left-length 100
set -g status-left-style bg=default,fg=black,bold
# right side of status bar holds "[host name] (date time)"
set -g status-right '#[fg=yellow] #H#[fg=white]:#[fg=yellow]#S #[fg=blue,bg=default] %m/%d/%Y %-l:%M %p'
set -g status-right-length 100
set -g status-right-style fg=black,bold
# make background window look like white tab
set-window-option -g window-status-format '#[fg=yellow,bg=default] #I #[fg=brightblack,bg=default] #W #[default]'
set-window-option -g window-status-style bg=default,fg=white,none
# make foreground window look like bold yellow foreground tab
set-window-option -g window-status-current-format '#[fg=black,bg=yellow] #I #[fg=white,bg=brightblack] #W #[default]'
set-window-option -g window-status-current-style none
# active terminal yellow border, non-active white
set -g pane-border-style bg=default,fg=colour238
set -g pane-active-border-style bg=default,fg=yellow
set-option -g renumber-windows on
# Setup 'v' to begin selection as in Vim
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy"
# Setup mouse to copy selection on drag
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy"
# Update default binding of `Enter` to also use copy-pipe
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "pbcopy"
# Bind ']' to use pbpaste
bind ] run "pbpaste | tmux load-buffer - && tmux paste-buffer"