aboutsummaryrefslogtreecommitdiff
path: root/stow/tmux/.tmux.conf
blob: db37de0b59b6209adf471d766e65f1fb2db33ecb (plain)
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
#####################################
# Bindings
#####################################


# Try using space as the prefix
# I hate over-writing ctrl+b for vim
unbind C-Space
set -g prefix C-Space
bind C-Space send-prefix
# Splits always start in the current pane's working directory
unbind '"'
unbind %
bind '"' split-window -v -c "#{pane_current_path}"
bind C-s split-window -v -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind C-v split-window -h -c "#{pane_current_path}"
# Vim movements
bind C-h select-pane -L
bind C-j select-pane -D
bind C-k select-pane -U
bind C-l select-pane -R
# Easy resizing of the pane
bind H resize-pane -L 3
bind J resize-pane -D 3
bind K resize-pane -U 3
bind L resize-pane -R 3
# Rollodex commands
bind n run-shell "~/.tmux/scripts/rolodex next"
bind p run-shell "~/.tmux/scripts/rolodex prev"
bind C-m run-shell "~/.tmux/scripts/rolodex toggle"
bind C-e run-shell "~/.tmux/scripts/rolodex new"
# Faster window switching
bind C-n next-window
bind C-p previous-window
# Use C-b to switch to last session
unbind C-b
bind C-b switch-client -l
# Synchronize mode
bind a set-window-option synchronize-panes
# Remap zoom, sleeping tmux way too much
bind C-Space resize-pane -Z
# I constantly mix up copy/paste. Very annoying/dangerous if cliboard has commands in it
unbind [
bind C-f copy-mode
# Tmux copy commands
bind -Tcopy-mode-vi v send -X begin-selection
bind -Tcopy-mode-vi y send -X copy-pipe-and-cancel "tmux save-buffer - | xp"
# Hitting enter will copy text but not leave vi mode
unbind -T copy-mode-vi Enter
bind -Tcopy-mode-vi Enter send -X copy-pipe "tmux save-buffer - | xp"
# clock mode is over written by sessionist
bind C-t clock-mode
# Use fzf for switching sessions
bind C-d \
  display-popup \
  -E \
  "tmux list-sessions \
   | sed -E 's/:.*$//' \
   | grep -v \"^$(tmux display-message -p '#S')\$\" \
   | fzf --reverse \
   | xargs tmux switch-client -t"

#####################################
# Settings
#####################################

# Help with the color problems
set -g default-terminal "xterm-kitty"
# Mouse Scrolling
set-option -g mouse off
# Use vim keybindings in copy mode and help menus
setw -g mode-keys vi
# Set the display panes timeout
set-option -g display-panes-time 4000
# Make the escape faster, faster command sequences
set -s escape-time 0
# Deal with screens having different sizes
set-window-option -g aggressive-resize
# Use base 1 numbering, 0 base is a big stretch
set -g base-index 1
setw -g pane-base-index 1
# Increase the history
set -g history-limit 50000
# Beautiful 24 bit color
set -ga terminal-overrides ",xterm-kitty:Tc"

#####################################
# Colors
#####################################

set-option -g status-style "fg=colour255"
set-option -g pane-border-style "fg=colour236"
set-option -g pane-active-border-style "fg=colour239"
set-option -g message-style "fg=colour196"
set-option -g status on
set-option -g status-interval 2
set-option -g status-justify "centre"
set-option -g status-left-length 110
set-option -g status-left "#S [#H]"
set-option -g status-right "#{?window_bigger,[#{window_offset_x}#,#{window_offset_y}] ,}\"#{=21:pane_title}\" %H:%M %Y-%m-%d"
set-option -g focus-events on
# If you have windows 1, 2, 3 and delete 2 I want the remaining to be 1, 2 not 1, 3
set-option -g renumber-windows on

# Log focus to file
set-hook -g pane-focus-in 'run "echo I #{pane_id} $(date) >>/tmp/focus"'

# List of plugins
set -g @plugin 'tmux-plugins/tpm'
# No plugins for now

# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'