summaryrefslogtreecommitdiff
path: root/.config/tmux/tmux.conf
blob: a99f6aeb02a2b38b1759696ea52f87a068a8c0f2 (plain)
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
##############################
########## KEYBINDS ##########
##############################

#----- SYSTEM -----#
# [Alt-space] Prefix key
unbind C-b
set-option -g prefix M-Space
bind M-Space send-prefix

# [Prefix-r] Reload configuration
bind r source-file ~/.config/tmux/tmux.conf \; display-message "Config reloaded"

#----- SESSIONS -----#
# `tmux a` to attach session
# [Prefix-s] Session selector
# [Prefix-d] Detach session

# [Prefix-S] Create new session
bind S command-prompt -p "New Session:" "new-session -A -s '%%'"

# [Prefix-K] Kill current session
bind K confirm kill-session

# [Prefix-R] Set session default filesystem location
bind R attach-session -c '#{pane_current_path}' \; display-message "New default location set"

#----- WINDOWS -----#
# [Ctrl-c] Create new window

# [Ctrl-h/l] Switch windows
bind -n C-h previous-window
bind -n C-l next-window

# [Ctrl-Alt-h/l] Change window order
bind -n C-M-h swap-window -t -1 \; previous-window
bind -n C-M-l swap-window -t +1 \; next-window

#----- PANES -----#
# [Prefix-v/h] Create new pane
bind v split-window -h
bind h split-window -v

# [Alt-h/j/k/l] to switch panes
bind -n M-h select-pane -L
bind -n M-l select-pane -R
bind -n M-k select-pane -U
bind -n M-j select-pane -D

###################################
########## SYSTEM CONFIG ##########
###################################

# Source bashrc
set-option -g default-command $SHELL

# Set base index to 1
set -g base-index 1
set-window-option -g pane-base-index 1

# Synchronize panes
set -s command-alias[100] 'sync=set-window-option synchronize-panes'

# Enable mouse controls
set -g mouse on

####################################
########## DISPLAY CONFIG ##########
####################################

# Status bar
set-option -g status-right ""
set-option -g status-position top

# Set status bar colors
set-option -g status-style "fg=white,bg=black"
set-option -g window-status-current-style "fg=black,bg=white"

###########################
########## INDEX ##########
###########################
# -g for global
# Prefix key prepends any keybinds by default
# -n to not require prefix key
# C - CTRL key
# M - ALT key