-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.tmux.conf
More file actions
83 lines (64 loc) · 2.86 KB
/
Copy path.tmux.conf
File metadata and controls
83 lines (64 loc) · 2.86 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
set-option -g default-shell /bin/zsh
set-option -g focus-events on
set-option -g allow-passthrough on
# use C-a, since it's on the home row and easier to hit than C-b
unbind-key C-b
unbind-key C-a
set-option -g prefix C-a
bind-key C-a send-prefix
# Easy config reload
bind r source-file ~/.tmux.conf \; display-message "tmux.conf reloaded."
# Enable hyperlinks everywhere and modern rendering features in the terminals I use.
set-option -sa terminal-features ",*:hyperlinks,xterm-ghostty:RGB:sync,st-256color:RGB"
# vi is good
set -g status-keys vi
set-window-option -g mode-keys vi
bind-key -T copy-mode-vi v send -X begin-selection
bind-key -T copy-mode-vi V send -X select-line
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
bind-key -T copy-mode-vi Enter send-keys -X copy-selection-and-cancel
## Set the word separators to get closer to vim's
set-option -g word-separators " -_()@.,[]{}:=\/"
# Use system clipboard for copy-pasting
set -g set-clipboard on
# mouse behavior
set -g mouse on
# Start windows and panes at 1, not 0 for easier navigation
set -g base-index 1
setw -g pane-base-index 1
# Automatically renumber windows when one is killed.
set -g renumber-windows on
# Keep generous scrollback without letting tmux grow without bound.
set -g history-limit 200000
# Keep Escape responsive for Vim without conflicting overrides.
set -sg escape-time 10
# More keys to bind
set -s extended-keys on
# Theme sets the status line and pane colours.
run-shell ~/work/misc/tmux-onedark-theme/tmux-onedark-theme.tmux
# Keep native tmux popups aligned with the One Dark terminal theme.
set -g popup-style "fg=#aab2bf,bg=#282c34"
set -g popup-border-style "fg=#5c6370,bg=#282c34"
# Kitty-style hints for URLs, paths, SHAs, and other visible text.
set -g @fingers-enable-bindings 0
set -g @fingers-pattern-bazel-target '(^|[^A-Za-z0-9_:/.@+-])(?<match>(@@?[A-Za-z0-9_.+~-]+)?//[A-Za-z0-9_./+~-]*(?::[A-Za-z0-9_./+=,@~%*-]+)?)'
run-shell ~/.tmux/plugins/tmux-fingers/tmux-fingers.tmux
bind f run-shell -b "#{@fingers-cli} start #{pane_id}"
bind J run-shell -b "#{@fingers-cli} start #{pane_id} --mode jump"
bind u run-shell -b "#{@fingers-cli} start #{pane_id} --patterns url --main-action :open:"
bind B run-shell -b "#{@fingers-cli} start #{pane_id} --patterns bazel-target --main-action 'bazel-target-open open'"
bind F command-prompt { find-window -Z "%%" }
# Renaming pane
set-option -g automatic-rename on
set-option -g automatic-rename-format '#{s/sluongngoc/me/:#{d:pane_current_path}}/#{b:pane_current_path} | #{pane_current_command}'
# Switch back and forth between windows, screen-style.
# bind a last-window
# bind C-a last-window
# When opening a new window, use the CWD.
unbind c
bind c new-window -c "#{pane_current_path}"
# Use saner splitting commands.
unbind %
unbind '"'
bind l split-window -h -c "#{pane_current_path}"
bind j split-window -v -c "#{pane_current_path}"