-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_tmux.conf
108 lines (82 loc) · 2.49 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
# references:
# https://github.com/gpakosz/.tmux/blob/master/.tmux.conf
# https://github.com/dwmkerr/dotfiles/blob/main/tmux/tmux.conf
# https://github.com/thoughtbot/dotfiles/blob/main/tmux.conf
# General
# ----------------
# remaps prefix to Ctrl+a
unbind C-b
set -g prefix 'C-a'
bind 'C-a' send-prefix
# escape time (faster commands)
set -sg escape-time 0
# config reload
bind r source-file ~/.tmux.conf \; display-message "Sourced ~/.tmux.conf"
# set the default shell, and set the default command to use our shell (this
# means we source things properly, show the correct PS1 etc).
set -g default-shell ${SHELL}
set -g default-command ${SHELL}
# default terminal
set -g default-terminal screen-256color
# Display
# ----------------
# window and pane index start at one (to match number keys)
set -g base-index 1
setw -g pane-base-index 1
# window names and renumbering when closed
setw -g automatic-rename on
set -g renumber-windows on
# terminal title
set -g set-titles on
# remove administrative debris (session name, hostname, time) in status bar
set -g status-left ''
set -g status-right ''
# Mouse
# ----------------
# enable mouse
set -g mouse on
# Pane and window navigation
# ----------------
# reset existing behavior for hjkl keys
unbind h
unbind j
unbind k
unbind l
# reset existing behavior for arrow keys
unbind Up
unbind Down
unbind Left
unbind Right
# split planes in same working directory
bind v split-window -h -c "#{pane_current_path}"
bind s split-window -v -c "#{pane_current_path}"
# pane navigation
bind -r C-k select-pane -U
bind -r C-j select-pane -D
bind -r C-h select-pane -L
bind -r C-l select-pane -R
# pane swapping
bind -r > swap-pane -D
bind -r < swap-pane -U
# pane resizing
bind -r K resize-pane -U 2
bind -r J resize-pane -D 2
bind -r H resize-pane -L 2
bind -r L resize-pane -R 2
# window navigation
bind -r C-Up last-window
bind -r C-Left previous-window
bind -r C-Right next-window
# window swapping
bind -r S-Left swap-window -t -1\; select-window -t -1
bind -r S-Right swap-window -t +1\; select-window -t +1
# Nested session
# ----------------
# Use prefix+b to send the leader to a nested session. This means if you are
# using tmux and then ssh into a tmux session (i.e. a nested session) you
# can run commands in the nested session with prefix b <command>.
bind b send-prefix
# Navi
# ----------------
# navi widget
bind -T prefix C-g split-window "$SHELL --login -i -c 'navi --print | head --bytes -1 | tmux load-buffer -b tmp - ; tmux paste-buffer -p -t {last} -b tmp -d'"