-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
81 lines (62 loc) · 2.44 KB
/
.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
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. Require tmux 3.4, which is built from source
set-option -sa terminal-features ",*:hyperlinks"
# 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
if-shell "uname | grep -q Darwin" \
"bind-key -T copy-mode-vi y send -X copy-pipe-and-cancel 'pbcopy';" \
"bind-key -T copy-mode-vi y send -X copy-pipe-and-cancel 'xclip -sel clip -i';"
unbind -T copy-mode-vi Enter
if-shell "uname | grep -q Darwin" \
"bind-key -T copy-mode-vi Enter send -X copy-pipe-and-cancel 'pbcopy';" \
"bind-key -T copy-mode-vi Enter send -X copy-pipe-and-cancel 'xclip -sel clip -i';"
## 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 external
# mouse behavior
set -g mouse on
# Fix Escape time affecting vim
set -sg escape-time 0
# 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
# Disable the status bar. The window title is sufficient.
set -g status off
# Set history limit ridiculously high.
set -g history-limit 1073741824
# Don't add any delay for pressing the escape key.
# Without this, vim becomes *really* annoying to use.
# The default is 500ms. Reduce it substantially.
set -g escape-time 20
# Make sure tmux support colors
set-option -ga terminal-overrides ",st-256color:Tc"
run-shell ~/work/misc/tmux-onedark-theme/tmux-onedark-theme.tmux
# 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}"