-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdot_tmux.conf
131 lines (102 loc) · 4.71 KB
/
dot_tmux.conf
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# !/opt/homebrew/bin/tmux
# Vars------------------------------------------------------------------------------------------------
TMUX_FZF_LAUNCH_KEY="f"
TMUX_FZF_PREVIEW=0
TMUX_FZF_ORDER="window|session|pane|command|keybinding|clipboard|process"
# General-----------------------------------------------------------------------------------------------
set -g mouse on
set-window-option -g mode-keys vi
# decrease command delay (increases vim responsiveness)
set -sg escape-time 0
# increase repeat time for repeatable commands
set -g repeat-time 1000
set -g history-limit 1000000 # significantly increase history size
set-option -g detach-on-destroy off
set -g default-shell /bin/zsh
set -g allow-passthrough on
bind C-t clock-mode
# Window and Pane Management---------------------------------------------------------------------------
# Rename session in alphanumerical order
bind s choose-tree -sZr -O name
# highlight window when it has new activity
setw -g monitor-activity on
set -g visual-activity on
# Numbering Windows and Panes
set -g base-index 1
setw -g pane-base-index 1
set -g renumber-windows on
# Status-----------------------------------------------------------------------------------------------
set-option -g status-interval 1
set-option -g status-left-length 100
set-option -g status-right-length 100
set-option -g status-left ' #S | '
set-option -g status-right '#(cd #{pane_current_path} && starship module git_branch) #(cd #{pane_current_path} && starship module directory)'
set-option -g status-style "fg=#54546d,bg=default"
set-option -g window-status-style "fg=#54546d,bg=default"
set-option -g window-status-current-style "fg=#C8C093,bg=default"
set-option -g window-status-last-style "fg=#54546d,bg=default"
set-option -g window-status-activity-style "fg=#54546d,bg=default"
# UI & colors-------------------------------------------------------------------------------------------
# ==================
# {n}vim compability
# MacOS ships with a very old ncurses and terminfo. May need to update terminfo to recognize tmux-256color.
# https://gist.github.com/bbqtd/a4ac060d6f6b9ea6fe3aabe735aa9d95
set -g default-terminal "tmux-256color"
# set -ag terminal-overrides ",xterm-256color:RGB"
set-option -gas terminal-overrides "*:Tc" # true color support
set-option -gas terminal-overrides "*:RGB" # true color support
set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' # undercurl support
set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' # underscore colours - needs tmux-3.0
# Keybinds and remaps------------------------------------------------------------------------------------
# Swapping Windows
bind -r "<" swap-window -d -t -1
bind -r ">" swap-window -d -t +1
# Panes
set -g pane-border-style fg=#16161D
set -g pane-active-border-style fg=#16161D
unbind %
bind | split-window -hc "#{pane_current_path}"
bind-key "\\" split-window -fh -c "#{pane_current_path}"
unbind '"'
bind - split-window -vc "#{pane_current_path}"
bind -r j resize-pane -D 2
bind -r k resize-pane -U 2
bind -r l resize-pane -R 2
bind -r h resize-pane -L 2
bind -r m resize-pane -Z
bind q kill-pane
# Reload
unbind r
bind r source-file ~/.tmux.conf
# Jump to last window
bind-key Space last-window
# Jump to last session
bind-key Escape switch-client -l
# Vim mode
bind-key -T copy-mode-vi 'v' send -X begin-selection # start selecting text with "v"
bind-key -T copy-mode-vi 'y' send -X copy-selection # copy text with "y"
unbind -T copy-mode-vi MouseDragEnd1Pane # don't exit copy mode when dragging with mouse
bind-key -T copy-mode-vi WheelUpPane send-keys -X halfpage-up
bind-key -T copy-mode-vi WheelDownPane send-keys -X halfpage-down
# Utilities
bind-key g new-window -n "LazyGit" -c "#{pane_current_path}" "lazygit"
bind-key d new-window -n "LazyDocker" -c "#{pane_current_path}" "lazydocker"
bind / popup -E -w 80% -h 80% "nvim ~/scratch.md"
bind e popup -E -w 80% -h 80% -d "#{pane_current_path}" "lf ."
# Plugins ---------------------------------------------------------------------------------------------------------
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'wfxr/tmux-fzf-url'
# Configurations
# open tmux-fzf-url in a tmux v3.2+ popup
set -g @fzf-url-fzf-options '-w 50% -h 50% --multi -0 --no-preview'
# Automatically restore tmux windows when tmux starts.
set -g @continuum-restore 'on'
# Preserves what was readable in each pane.
set -g @resurrect-capture-pane-contents 'on'
set -g @resurrect-strategy-nvim 'session'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'