-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
85 lines (69 loc) · 3.08 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
# The default prefix of C-b is used by Spacemacs & Vim to scroll a page up so I
# bind it to another key.
set -g prefix C-a
unbind C-b
# C-a means "go to beginning of line" in vanilla Emacs and in multiple shells,
# so tmux should pass it through to the active pane when the user presses it
# twice.
bind C-a send-prefix
# Bind the reload of the tmux configuration to a key.
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# Start numbering the windows at 1 (instead of at 0)
set -g base-index 1
# Start numbering the panes at 1 (instead of at 0)
set -g pane-base-index 1
# Show pane numbers until you select one
bind q display-panes -d 0
# I find it diffult to remember which binding splits a pane horizontally (%) and
# which vertically ("). I also bind them to keys that provide a visual cue.
bind | split-window -h
bind - split-window -v
# Use vi bindings for cursor movement in copy mode
set-window-option -g mode-keys vi
# Use vi bindings to copy and yank
bind-key -T copy-mode-vi v send -X begin-selection
bind-key -T copy-mode-vi y send -X copy-selection
# It seems obvious to bind key p to paste but I prefer to keep that binding to
# move to the next window. The default binding for paste is prefix + ], so let's
# just use that.
# Let tmux be aware of the mouse
set -g mouse on
# If you want to temporarily switch this mouse-awareness off, press shift when
# you use the mouse. For example, when you press shift when you use the mouse to
# select text, the terminal handles the text selection and, depending on the
# terminal, copies the selected text to the system clipboard.
# tmux can set the contents of the system clipboard using xterm escape sequence
# OSC 52. My preferred terminal, xfce4-terminal, does not support that and just
# overwrites the contents of the tmux window so I disable it.
set -g set-clipboard off
# The following bug report exists for the fact that the VTE Terminal Widget
# library, which is the library used by xfce4-terminal and other terminals,
# doesn't handle OSC 52: https://bugzilla.gnome.org/show_bug.cgi?id=795774
# Remap pane movement keys
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Bind keys to resize panes
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
# Let tmux display things in 256 colors
set-option -g default-terminal "tmux-256color"
# Hide the status bar as it adds visual clutter when using terminal emacs. If
# you want to toggle (!) it at runtime, execute command
#
# set-option -g status
#
# (so without "off" or "on").
# set-option -g status off
# I use terminal Emacs (Spacemacs) with theme spacemacs-dark. Let the status and
# message line blend in with that theme, whose background color is colour235.
set -g status-style fg=white,bg=colour235
set -g message-style fg=white,bold,bg=colour235
# Emacs actively uses the bottom line for the minibuffer. Move the window list
# to the centre so the messages in the minibuffer are easier to read.
set -g status-justify centre
set-option -sg escape-time 10 # millisecond delay
set-window-option -g xterm-keys on