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


# Splits always start in the current pane's working directory
unbind '"'
unbind %
bind '"' split-window -v -c "#{pane_current_path}"
bind C-f split-window -v -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind C-c 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"
# Bind the last window/pane command
bind C-b last-pane
# Faster window switching
bind C-n next-window
bind C-p previous-window
bind S switch-client -l
# Synchronize mode
bind a set-window-option synchronize-panes
# Remap zoom, sleeping tmux way too much
bind C-v resize-pane -Z
# I constantly mix up copy/paste. Very annoying/dangerous if cliboard has commands in it
unbind [
bind C-g 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
unbind s
bind s \
  display-popup \
  -E \
  "tmux list-sessions \
   | sed -E 's/:.*$//' \
   | grep -v \"^$(tmux display-message -p '#S')\$\" \
   | fzf --reverse \
   | xargs tmux switch-client -t"
# Renumber the windows
bind C-w run-shell "~/.tmux/scripts/window_renum"

#####################################
# 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
# 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'
set -g @plugin 'Thornycrackers-Forks/tmux-sessionist'
set -g @plugin 'Thornycrackers-Forks/tmux-open'
set -g @plugin 'Thornycrackers-Forks/tmux-fingers'
set -g @fingers-main-action 'tmux save-buffer - | xp'

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