-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
86 lines (62 loc) · 2.23 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
# Initialize sessions.
bind S source-file ~/.tmux/sess/sess.work
bind H source-file ~/.tmux/sess/sess.blog
# Renumber windows sequentially after closing any of them.
set -g renumber-windows on
# Use vi keybindings for tmux commandline input.
set -g status-keys vi
# Copy text with 'mouse' set to 'on' by holding down the [Option] key.
#
# See: https://stackoverflow.com/a/23906493
# set -g mouse on
# to enable mouse scroll, see https://github.com/tmux/tmux/issues/145#issuecomment-150736967
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e'"
# Reload tmux config.
bind r source-file ~/.tmux.conf \; display "Reloaded!"
set -g default-terminal "xterm-256color"
set -g status on
set-option -g allow-rename off
set-option -g history-limit 50000
# Custom prefix.
unbind C-b
set -g prefix C-Space
bind Space copy-mode
bind C-Space copy-mode
# Split window vertically and horizonally.
bind | split-window -h -c "#{pane_current_path}"
bind _ split-window -v -c "#{pane_current_path}"
bind-key w kill-window
bind-key C-q kill-window
bind-key W kill-window -a
bind-key x kill-pane
bind-key C-x kill-pane
bind X confirm-before kill-session
setw -g aggressive-resize on
# Copy to macOS clipboard.
bind-key -Tcopy-mode-vi 'v' send -X begin-selection
bind-key -Tcopy-mode-vi 'y' send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
# Use vim keybindings in copy mode.
setw -g mode-keys vi
# Speed up commands.
set-option -sg escape-time 0
# Clear the current pane.
bind -n C-k send-keys C-l \; clear-history
# Set window name when creating a new window.
bind-key c command-prompt -p "window name:" "new-window; rename-window '%%'"
# Status update interval.
set -g status-interval 1
# Start file/pane index at 1 for improved usability.
set -g base-index 1
setw -g pane-base-index 1
# Resize panes like vim.
bind < resize-pane -L 10
bind > resize-pane -R 10
bind - resize-pane -D 10
bind + resize-pane -U 10
# Allow fast pane switching without having to wait to rerun a command.
# @see: https://superuser.com/a/325579
set-option -g repeat-time 0
# Theme configuration.
#
# @see: https://github.com/jimeh/tmux-themepack
source-file $HOME/.tmux/themes/tmux-themepack/basic.tmuxtheme