-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdot_tmux.conf
More file actions
118 lines (92 loc) · 3.41 KB
/
dot_tmux.conf
File metadata and controls
118 lines (92 loc) · 3.41 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
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
# Reload configuration with superkey + r
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# Set Ctrl-a as super key
set -g prefix C-a
set -g allow-passthrough on
unbind C-b
bind-key x kill-pane
bind-key X kill-window
bind-key q confirm-before kill-session
bind-key Q confirm-before kill-server
bind-key -r h previous-window # <
bind-key -r l next-window # >
bind-key < swap-window -t :-
bind-key > swap-window -t :+
bind-key n command-prompt 'rename-window %%'
bind-key N command-prompt 'rename-session %%'
bind-key Escape copy-mode -u
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind-key -n 'C-\' if-shell "$is_vim" "send-keys 'C-\\'" "select-pane -l"
bind-key -T copy-mode-vi C-h select-pane -L
bind-key -T copy-mode-vi C-j select-pane -D
bind-key -T copy-mode-vi C-k select-pane -U
bind-key -T copy-mode-vi C-l select-pane -R
bind-key -T copy-mode-vi 'C-\' select-pane -l
# Remap clear screen binding
bind C-l send-keys 'C-l'
# Run htop
# bind-key h split-window -h "htop"
# Vim mod for copying
setw -g mode-keys vi
unbind -Tcopy-mode-vi Enter
bind -Tcopy-mode-vi Enter send -X copy-pipe "xclip -i -sel p -f | xclip -i -sel c" \; display-message "copied to system clipboard"
# set status bar
set -g status-right-length 60
set -g status-left-length 60
# pane border and colors
set -g pane-active-border-style fg=yellow
set -g pane-border-style fg=white
# highlight active window
set -g status-style bg=colour235,fg=yellow,dim #base02
setw -g window-status-current-style bg=colour166,fg=yellow,bold
setw -g window-status-current-format ' #I #W '
# Turn on mouse features
set -g -q mouse on
# Enable extended keys
set -s extended-keys on
set -as terminal-features 'xterm*:extkeys'
set -as terminal-features 'tmux-256color:extkeys'
# Allow passthrough for modern terminals
set -g allow-passthrough on
# support for 256 color
set -g default-terminal "tmux-256color"
# Enable RGB colors and extended keys for Ghostty
set -as terminal-overrides ',xterm-ghostty:RGB'
set -as terminal-features ',xterm-ghostty:extkeys'
# Change horizental and vertical keybinding
bind '/' split-window -h
bind '-' split-window -v
# We can now repatedly resize panes
bind-key -r C-h resize-pane -L 5
bind-key -r C-l resize-pane -R 5
bind-key -r C-j resize-pane -D 5
bind-key -r C-k resize-pane -U 5
# make C-a available to other programs too (need to press C-a two times)
bind C-a send-prefix
# Remove tmux delay
set -sg escape-time 1
# Start windows index from 1
set -g base-index 1
#set -g renumber-windows on
# Start pane index from 1
setw -g pane-base-index 1
# move the pane to a new window
bind-key b break-pane -d
# Set shell title
set-option -g set-titles on
set-option -g set-titles-string "#S / #W"
# Notify on changes
setw -g automatic-rename off
set -g allow-rename off
set-option -g focus-events on
set -g history-limit 20000
bind-key ! run-shell '(tmux switch-client -l || tmux switch-client -n) && tmux kill-session -t "#S" || tmux kill-session'
unbind C-Enter
bind-key -n S-Enter send-keys Escape "[13;2u"