-
Notifications
You must be signed in to change notification settings - Fork 1
/
.tmux.conf
157 lines (119 loc) · 4.68 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
################################################################################
# @name: .tmux.conf
# @author: Eli Gundry
################################################################################
################################################################################
# => General Settings
################################################################################
# ZSH as default shell
set -g default-shell $SHELL
# Allow 256 colors as well as bolds and italics
# This requires running `tic -x ~/.tmux/tmux-256color.ti`
# https://www.reddit.com/r/neovim/comments/9mj1mh/comment/e7f1pmh/
set -g default-terminal "tmux-256color"
set -as terminal-overrides ',xterm*:Tc:sitm=\E[3m'
# Allow the clipboard
set -g set-clipboard on
# No bells ever!
set -g visual-bell off
set -g bell-action none
# Set titles
set -g allow-rename on
set -g set-titles on
set -g set-titles-string '#W'
# No escape time
set -s escape-time 0
# Allow for longer history
set -g history-limit 10000
# Start window numbering at 1
set -g base-index 1
# Allow alternate screen
set -g alternate-screen on
# Allow for automatic renaming of windows
set -g automatic-rename on
# Allow base16 colorschemes to work
set -g allow-passthrough all
# Neovim needs these?
set-option -g focus-events on
set-option -sa terminal-features ',XXX:RGB'
# I was anti-mouse for so long, but it's time to get back on the bandwagon. It's
# very useful and I'm so tired of learning more key combinations.
set -g mouse on
################################################################################
# => Key Bindings
################################################################################
# I like C-A
set -g prefix C-a
unbind C-b
bind C-a send-prefix
# ...except when on ssh
# if-shell "echo $SSH_CONNECTION | wc -w" "source-file ~/.tmux.ssh.conf"
# k should kill a window
unbind x
unbind &
bind x confirm "kill-window"
bind X kill-window
bind K kill-pane
# Tmux 1.9 killed current dir in new windows :(
bind c new-window -c "#{pane_current_path}"
# R will refresh .tmux.conf
bind R source-file $HOME/.tmux.conf \; display-message "~/.tmux.conf sourced"
# Kill all sessions but the current one
bind F3 kill-session -a \; display-message "Sessions cleaned!"
# C-a C-a goes back to last previous window
bind C-a last-window
# C-a C-l clears the scrollback history
bind C-l clear-history
# Vi status keys
set -g status-keys vi
set -g mode-keys vi
# Allow for Vi style copying
# @TODO The latest version of tmux on OSX changed the send-keys syntax. This
# config has not been pushed to debian testing yet. As such, these aliases have
# been moved to the platform specific config files in .tmux
bind -T copy-mode-vi 'v' send-keys -X begin-selection
bind -T copy-mode-vi 'y' send-keys -X copy-selection
bind P paste-buffer
# Allow neovim to change cursors on insert mode and normal mode
set -g -a terminal-overrides ',*:Ss=\E[%p1%d q:Se=\E[2 q'
# Better window splitting
unbind %
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
bind _ 'split-window -v -c "#{pane_current_path}"; resize-pane -D 25'
# Better split navigation
unbind Up
unbind Down
unbind Right
unbind Left
bind k select-pane -U
bind j select-pane -D
bind h select-pane -L
bind l select-pane -R
################################################################################
# => Platform Specific
################################################################################
# if-shell "uname | grep -q Darwin" "source-file ~/.tmux/osx.conf" "source-file ~/.tmux/linux.conf"
################################################################################
# => Screensaver
################################################################################
set -g lock-after-time 0
set -g lock-command 'cbonsai --live --infinite'
bind F6 set -g lock-after-time 0 \; display-message "Screensaver disabled"
bind F5 set -g lock-after-time 600 \; display-message "Screensaver enabled"
################################################################################
# => Powerline
################################################################################
source-file $HOME/.tmux/tmuxline/base16_default.conf
################################################################################
# => Tmux Plugin Manager
# https://github.com/tmux-plugins/tpm
################################################################################
set -g @plugin 'tmux-plugins/tpm'
# Allows for opening of text in tmux copy mode
# `o` runs the file through `xdg-open` or MacOS `open`
# `Ctrl-o` opens the files in $EDITOR
# `Shift-s` searches the text in Google
set -g @plugin 'tmux-plugins/tmux-open'
set -g @open-S 'https://www.google.com/search?q='
run '~/.tmux/plugins/tpm/tpm'