summaryrefslogtreecommitdiff
path: root/.config/tmux/tmux.conf
blob: 8622d0860c000d2efcf693732d660a1e805e6ab1 (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
# With this ~/.bashrc is loaded.
set-option -g default-command /usr/bin/zsh

# To satisfy the warnings in vim's checkhealth about tmux's colour settings.
set-option -sa terminal-overrides ',xterm-256color:RGB'

# Move through panes using vim mappings while alt key is pressed.
# bind -n M-h select-pane -L
# bind -n M-j select-pane -D
# bind -n M-k select-pane -U
# bind -n M-l select-pane -R

# Open new windows/panes using the current window's path.
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"

# Use vi-like bindings for copy-mode.
# First unbind the default rectangle-toggle binding.
unbind-key -T copy-mode-vi 'v'
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'C-v' send -X rectangle-toggle

# Send the URLs to urlscan in a new split window.
bind-key u split-window -l 10 'tmux capture-pane -t "$(tmux list-panes -f "#{pane_last}" -F "#{pane_index}")" -pJS - | urlscan'

# Plugin settings
# Set the plugins install dir.
set-environment -g TMUX_PLUGIN_MANAGER_PATH "$XDG_DATA_HOME/tmux/plugins/"
# Set the directory used by tmux-resurrect to store sessions.
set -g @resurrect-dir "$XDG_STATE_HOME/tmux/resurrect"
set -g @resurrect-capture-pane-contents 'on'
# Additional programs tmux-resurrect should restore.
set -g @resurrect-processes 'btop neomutt profanity newsboat'
# Use pywal theme in tmux-power.
set -g @tmux_power_theme 'default'
# 'L' for left only, 'R' for right only and 'LR' for both
set -g @tmux_power_prefix_highlight_pos 'R'
# Use custom script cclip to handle both normal and ssh sessions.
set -g @override_copy_command 'cclip'

# List of plugins
set -g @plugin 'https://github.com/tmux-plugins/tpm'
set -g @plugin 'https://github.com/tmux-plugins/tmux-sensible'
set -g @plugin 'https://github.com/tmux-plugins/tmux-pain-control'
set -g @plugin 'https://github.com/tmux-plugins/tmux-yank'
set -g @plugin 'https://github.com/wfxr/tmux-power'
set -g @plugin 'https://github.com/tmux-plugins/tmux-prefix-highlight'
set -g @plugin 'https://github.com/tmux-plugins/tmux-resurrect'
set -g @plugin 'https://github.com/tmux-plugins/tmux-continuum'

# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'git@github.com:user/plugin'
# set -g @plugin 'git@bitbucket.com:user/plugin'


# Download tpm and install the plugins when running on a new machine.
run "$XDG_CONFIG_HOME/tmux/install_tpm.sh"
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run "$XDG_DATA_HOME/tmux/plugins/tpm/tpm"