-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtmux.conf
More file actions
90 lines (71 loc) · 3.38 KB
/
tmux.conf
File metadata and controls
90 lines (71 loc) · 3.38 KB
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
# Use zsh as default
set -g default-shell /bin/fish
# Enable 256-color and true-color (24-bit) support in tmux
set -g default-terminal "screen-256color" # Set terminal type for 256-color support
set -ga terminal-overrides ",*256col*:Tc" # Override to enable true-color for compatible terminals
# General
set -g set-clipboard on # Use system clipboard
set -g detach-on-destroy off # Don't exit from tmux when closing a session
set -g escape-time 0 # Remove delay for exiting insert mode with ESC in Neovim
set -g history-limit 1000000 # Increase history size (from 2,000)
set -g mouse on # Enable mouse support
set -g status-interval 3 # Update the status bar every 3 seconds (default: 15 seconds)
set -g allow-passthrough on # Allow programs in the pane to bypass tmux (e.g. for image preview)
# Set prefix key
unbind C-b # Unbind the default prefix key
set -g prefix C-Space # Set new prefix key to Ctrl+Space
# Refresh tmux config with r
unbind r
bind r source-file ~/.tmux.conf
# Split horizontally in CWD with \
unbind %
bind \\ split-window -h -c "#{pane_current_path}"
# Split vertically in CWD with -
unbind \"
bind - split-window -v -c "#{pane_current_path}"
# New window in same path
bind c new-window -c "#{pane_current_path}"
# Use vim arrow keys to resize
bind -r j resize-pane -D 5
bind -r k resize-pane -U 5
bind -r l resize-pane -R 5
bind -r h resize-pane -L 5
# Use m key to maximize pane
bind -r m resize-pane -Z
# Enable vi mode to allow us to use vim keys to move around in copy mode (Prefix + [ places us in copy mode)
set-window-option -g mode-keys vi
# Start selecting text with "v"
bind-key -T copy-mode-vi 'v' send -X begin-selection
# Copy text with "y"
bind -T copy-mode-vi 'y' send-keys -X copy-pipe-and-cancel "pbcopy"
# Paste yanked text with "Prefix + P" ("Prefix + p" goes to previous window)
bind P paste-buffer
# Don't exit copy mode when dragging with mouse
unbind -T copy-mode-vi MouseDragEnd1Pane
# Start windows and panes at 1, not 0
set -g base-index 1
set -g pane-base-index 1
set -g renumber-windows on # Automatically renumber windows when one is closed
set-option -g status-position top
# tpm plugin manager
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible' # optional recommended
set -g @plugin 'egel/tmux-gruvbox'
# set desired theme options...
set -g @tmux-gruvbox 'light256' # or 'dark256', 'light', 'light256'
set -g @tmux-gruvbox-statusbar-alpha 'true'
set -g @tmux-gruvbox-left-status-a '🌙'
set -g @tmux-gruvbox-right-status-x '%d-%m'
set -g @tmux-gruvbox-right-status-y 'DO'
set -g @tmux-gruvbox-right-status-z ''
# List of tmux plugins
set -g @plugin 'christoomey/vim-tmux-navigator' # Enable navigating between nvim and tmux
set -g @plugin 'tmux-plugins/tmux-resurrect' # Persist tmux sessions after computer restart
set -g @plugin 'tmux-plugins/tmux-continuum' # Automatically saves sessions every 15 minutes
set -g @plugin 'hendrikmi/tmux-cpu-mem-monitor' # CPU and memory info
set -g @plugin 'tmux-plugins/tmux-resurrect' # session restorer
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
# NOTE:
# - To apply theme changes: tmux kill-server && rm -rf /tmp/tmux-*
# - To avoid overlap, disable the Mac shortcut to switch input sources with Ctrl+Space in `System settings > Keyboard Shortcuts > Input Sources`