-
Notifications
You must be signed in to change notification settings - Fork 20
/
.tmux.conf
159 lines (121 loc) · 5.15 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
158
159
# My tmux config uses folds in vim.
#
# zR open all folds
# zM close all folds
# za toggle fold at cursor position
# zj move down to start of next fold
# zk move up to end of previous fold
# General tmux settings {{{1
# ------------------------------------------------------------------
# set the command prefix to match screen
set -g prefix C-a
unbind C-b
# Allow for C-a C-a to send it to the application
bind C-a send-prefix
# Set the proper terminal type
set -g default-terminal "tmux-256color"
# Set the delay so that it doesn't interfere with applications like
# vim
set -sg escape-time 0
# Allow true color in vim
set-option -sa terminal-overrides ',xterm-256color:RGB'
# Allow vim to get focus events
set-option -g focus-events on
# Make window and pane indexes start with 1
set -g base-index 1
setw -g pane-base-index 1
# use vi key bindings
setw -g mode-keys vi
# turn on mouse mode
setw -g mouse on
# Disable context menu on right click
unbind -T root MouseDown3Pane
# Copy mode when using scroll wheel
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e'"
bind -n WheelDownPane select-pane -t= \; send-keys -M
# Disable copy and cancel copy mode when selecting text
unbind-key -T copy-mode-vi MouseDragEnd1Pane
# Single click clears the selection
bind-key -T copy-mode-vi MouseDown1Pane select-pane\; send-keys -X clear-selection
# copy pasta
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe "clipboard" \; display-message 'Text copied to clipboard!'
bind-key -T copy-mode-vi y send-keys -X copy-pipe "clipboard" \; display-message 'Text copied to clipboard!'
# vi like copy mode
# from https://twitter.com/nickmorrott/status/928343075646210050?s=09
bind -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi V send-keys -X select-line
bind -T copy-mode-vi C-v send-keys -X rectangle-toggle \; send-keys -X begin-selection
bind -T copy-mode-vi Escape send-keys -X cancel
# set the scrollback
set -g history-limit 200000
# force tmux to use utf-8
setw -gq utf8 on
# Custom key bindings {{{1
# ------------------------------------------------------------------
# Reload the tmux config
bind r source-file ~/.tmux.conf \; display "tmux config reloaded!"
bind R source-file ~/.tmux/theme_claytron_slim.tmux \; display "no unicode chars in prompt"
# screen like logging of the current window
bind H pipe-pane -o 'cat >> $HOME/#W-`date +%s`-tmux.log'
# Make it obvious that this is a special window
bind P source-file ~/.tmux/warning.tmux
# Then back to normal
bind O source-file ~/.tmux/tmuxline_window.tmux
# Create a new session
bind S new-session
# Easier window controls {{{2
# ------------------------------------------------------------------
# Create a new window
bind c new-window -c "#{pane_current_path}"
# Move windows while holding control
bind C-p previous-window
bind C-n next-window
# Copy mode holding ctrl
bind C-[ copy-mode
# Switching between pane, window and client {{{2
# ------------------------------------------------------------------
# An easy way to remember is as follows, smallest, to biggest change
# ; ' Enter
# window client pane
# Put switch client back into place (was L)
unbind "'"
bind -r "'" switch-client -l
# Switch to last window
unbind ';'
bind -r ';' last-window
# Re-define swtich to last pane, so this is easier to remember
# TODO: seems like I've never used this, might remove it
bind -r Enter last-pane
# Appearance Settings {{{1
# ------------------------------------------------------------------
# Show notices when there is activity on another window
setw -g monitor-activity on
set -g visual-activity off
# Theme based on tmuxline
source-file ~/.tmux/tmuxline.tmux
# Status Line {{{1
# ------------------------------------------------------------------
# Force utf-8
set -gq status-utf8 on
# Localized settings for an OS {{{1
# ------------------------------------------------------------------
source-file ~/.tmux.local
# Plugins and settings {{{1
# ------------------------------------------------------------------
# tmux mode indicator {{{2
# ------------------------------------------------------------------
# prompt to display when tmux is in normal mode
set -g @mode_indicator_empty_prompt ' NORM '
# Make the prefix mode a bit more noticeable
set -g @mode_indicator_prefix_mode_style 'bg=green,fg=black'
# Plugin init {{{2
# ------------------------------------------------------------------
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'MunifTanjim/tmux-mode-indicator'
set -g @plugin 'jaclu/tmux-power-zoom'
set -g @plugin 'tmux-plugins/tmux-pain-control'
set -g @plugin 'tmux-plugins/tmux-open'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
# turn on folds
# vim: fdm=marker