-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot.tmux.conf
169 lines (141 loc) · 6.86 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# DGL TMUX Config
# based on https://github.com/kaushalmodi/dotfiles/blob/master/tmux/dot-tmux.conf
# PREFIX
set -g prefix M-p
unbind C-b # unbind the default binding to send prefix key to the application
# Often you'll run a tmux inside another tmux and need a command sequence to
# send things to the inner session. With below binding that can be accomplished
# using "PREFIX X <command>"
bind X send-prefix
# Pane Management
set -g pane-base-index 1 # start pane indices at 1
set -g main-pane-width 100 # used by selectl main-vertical
bind z resize-pane -Z # zoom/unzoom the current pane
# PREFIX ! : break-pane, convert the current pane to a window
# Select Panes
bind C-w select-pane -t :.+
bind C-W select-pane -t :.-
# PREFIX ; : last-pane or select-pane -l, switch to the last active pane
# PREFIX ← : select-pane -L, switch to the pane on the left
# PREFIX → : select-pane -R, switch to the pane on the right
# PREFIX ↑ : select-pane -U, switch to the pane on the top
# PREFIX ↓ : select-pane -D, switch to the pane on the bottom
# PREFIX { : swap-pane -U, swap current pane with the pane above (not literally above)
# PREFIX } : swap-pane -D, swap current pane with the pane below (not literally below)
# Dynamic Split
# PREFIX Up, Down, Right, Left : Move cursor from one pane to another
# PREFIX Space : Cycle through different pane layouts
# PREFIX C-o : rotate-window, rotate panes in the current window
# Window Management
set -g base-index 1 # start window indices at 1
# automatically renumber the windows
# http://unix.stackexchange.com/questions/21742/renumbering-windows-in-tmux
set -g renumber-windows on
bind C-f command-prompt -p "New window:" "new-window -c '#{pane_current_path}' -n %1"
bind C-r command-prompt -p "New name for this window:" "rename-window '%%'"
# bind L switch-client -l # default, switch to previously selected session
bind L list-windows -F '#{window_index}:#{window_name}: #{?pane_dead, (dead), (not dead)}'
# PREFIX & confirm-before -p "kill-window #W? (y/n)" kill-window
bind C-c confirm-before -p "Kill this window? (y/n)" kill-window
# bind m select-pane -m # default, mark the pane
# Move the current window to another window index in the same or any other session
bind m command-prompt -p "Move window to sess or sess:win# or win# (ex: kmodi or kmodi:3 or 2(of current session)):" "move-window -t '%%'"
# Move or bring a window from a different session to the current one
# bind M select-pane -M # default, unmark the pane
bind M command-prompt -p "Move the window from sess:win# (ex: kmodi:3):" "move-window -s '%%'"
# Window Navigation
# bind C-z suspend-client # default
bind C-z last-window # switch to last active window
# PREFIX l : last-window
# Split Window
# bind - delete-buffer # default
bind - split-window -v -c '#{pane_current_path}' # vertical split
bind _ split-window -v -c '#{pane_current_path}' -f # full vertical split (v2.3+)
bind \\ split-window -h -c '#{pane_current_path}' # horizontal split
bind | split-window -h -c '#{pane_current_path}' -f # full horizontal split (v2.3+)
# Layout
bind Space next-layout
bind C-Space select-layout -o # undo only the last layout change #v2.1
# * Session Management
bind C-t command-prompt -p "New name for this session:" "rename-session '%%'"
bind b switch-client -l # switch to previously selected session
# Mouse
set -g mouse on
# Drag pane border to resize
# bind -T root MouseDrag1Border resize-pane -M # default
# unbind -T root MouseDrag1Border # disable drag pane border to resize
bind-key -T copy-mode MouseDragEnd1Pane send-keys -X copy-selection -x
bind-key -T copy-mode-vi y send-keys -X copy-selection
bind-key -T copy-mode-vi v send-keys -X begin-selection
# Window Title
set -g set-titles on
set -g set-titles-string '#h :: #S:W#I(#W).P#P'
# Status Bar
set -g status-interval 5 # default = 15 seconds
#set -g status-justify centre
# Left Status
set -g status-left-length 20
# Change the left status when prefix is pressed.
# https://www.reddit.com/r/tmux/comments/5cm2ca/post_you_favourite_tmux_tricks_here/d9ziuy9/
set -g status-left "[#S] "
# Right Status
set -g status-right-length 20
set -g status-right "#{?client_prefix,#[fg=black]prefix pressed ..,%l:%M %b %d %a }"
# Pane Status
setw -g pane-border-status "bottom"
setw -g pane-border-format " #P #T "
setw -g pane-border-lines "single" # single, double, heavy, simple, number
# Terminal
# From `man tmux', about `default-terminal'
# Set the default terminal for new windows created in this session - the default
# value of the TERM environment variable. For tmux to work correctly, this must
# be set to ‘screen’, ‘tmux’ or a derivative of them.
# set -g default-terminal "screen"
# set -g default-terminal "screen-256color"
# Mon May 22 11:43:56 EDT 2017 - kmodi
# Blinking text (useful to show broken symlinks in ls) does not work when using tmux-24bits.
# set -g default-terminal "tmux-24bits"
# tmux-24bits is a custom terminfo profile created using the steps explained
# on https://github.com/ThomasAdam/tmux/blob/master/FAQ to support italics and
# 256 colors.
# Enable 24-bit color
# https://sunaku.github.io/tmux-24bit-color.html
# set -ga terminal-overrides ",screen-256color:Tc"
# set -ga terminal-overrides ",tmux-24bits:Tc"
# set -ga terminal-overrides ",alacritty:RGB"
# Thu May 31 17:10:04 EDT 2018 - kmodi
# TODO: Try the 24-bit emacs+tmux config for ST
# https://www.reddit.com/r/emacs/comments/8ndm2x/gnu_emacs_261_24bit_colors_suckless_st_terminal/dzwh4vv/
set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",*256col*:Tc"
#
setw -g xterm-keys on
# Uncomment below when using st (by suckless.org)
# set -g default-terminal "st-256color"
# # https://sunaku.github.io/tmux-24bit-color.html
# # st supports 24-bit color, so enable support for that in tmux
# set -ga terminal-overrides ",st-256color:Tc"
# setw -g xterm-keys off
# Server Options
set -s escape-time 0 # Allows for faster key repetition
# ** Session Options
# If I am doing a new-window or split-window without a specified command, start the tcsh
# shell by default.
set -g history-limit 100000
set -g display-time 1000 # Duration of tmux display messages in milliseconds
# Window Options
# When a smaller terminal connects to a tmux client, it shrinks to fit it. The
# clients attached with bigger displays see this constrained view.
# aggressive-resize makes it such that the window is only resized if the smaller
# client is actively looking at it.
setw -g aggressive-resize on
setw -g mode-keys vi # Use emacs keybindings in copy mode
setw -g status-keys vi
# tmux buffers
# PREFIX # : List all paste buffers
# PREFIX - : Delete the most recently copied buffer of text
# PREFIX = : Choose which buffer to paste interactively from a list
# PREFIX ] : Paste the most recently copied buffer of text
# Choose Tree
# PREFIX w: choose-tree -Zw
# PREFIX s: choose-tree -Zs