blob: 3cf53cb19aa297439e9b4379b2d01895a75540c8 (
plain) (
blame)
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
|
# Instead of using "C-b" as a prefix, use "C-x"
unbind C-b
set -g prefix C-x
# Turn on mouse mode
# https://groups.google.com/forum/#!msg/tmux-users/TRwPgEOVqho/Ck_oth_SDgAJ
# https://github.com/tmux/tmux/blob/310f0a960ca64fa3809545badc629c0c166c6cd2/CHANGES#L12
set -g mouse on
# Bind "C-x r" to reload the configuration file
bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded"
# Holy answer that properly implements copying from tmux!
# https://unix.stackexchange.com/a/349020/276661
if-shell "uname | grep -q Darwin" "source-file ~/.tmux-macos.conf" "source-file ~/.tmux-gnu-linux.conf"
# Moving around panes
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
# Resizing panes
bind-key -n C-h resize-pane -L 5
bind-key -n C-j resize-pane -D 5
bind-key -n C-k resize-pane -U 5
bind-key -n C-l resize-pane -R 5
# "C-x m" to actually clear the pane history
bind-key m send-keys -R \; clear-history
# Keybinding to activate pane typing sync
# https://stackoverflow.com/questions/25909964/tmux-how-to-toggle-on-and-off-options-with-the-same-key
bind-key b setw synchronize-panes \; display-message "synchronize-panes toggle"
setw -g mode-keys vi # Move around with vi keys
set-option -g status-key "vi" # Use vi mode for status bar command (like after typing "C-x [" one can search with "/")
set-option -g status-bg "#666666" # Status bar background color
set-option -g status-fg "#aaaaaa" # Status bar foreground color
set-option -g status-left-length 50 # session name in status bar length =[annex]= part
set-option -g history-limit 150000 # How many lines of history to keep
# Set the panes initial index value to 1 instead of 0
# 0 is too far from ` ;)
set -g base-index 1
set-window-option -g pane-base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
# Set "correct term"
# https://wiki.archlinux.org/index.php/Tmux
set -g default-terminal screen-256color
# No delay for escape key press
# https://mutelight.org/practical-tmux#faster-command-sequences
set -sg escape-time 0
# Enable arrow key navigation
set-option -gw xterm-keys on
|