-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
85 lines (76 loc) · 2.7 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
81
82
83
84
85
# Current version: tmux 3.0a
# For new file to take into effect: tmux kill-server && tmux
# Resources:
# https://www.hamvocke.com/blog/a-quick-and-easy-guide-to-tmux/
# https://www.hamvocke.com/blog/a-guide-to-customizing-your-tmux-conf/
# https://koenwoortman.com/tmux-remap-split-window-keys/
# Basic Tmux Usage:
# 1. tmux new -s my_session
# 2. Run the desired program.
# 3. Use the key sequence (Ctrl-b + d) to detach from the session.
# 4. Reattach to the tmux session by typing: tmux attach-session -t my_session
# Commands:
# - The default prefix key is: C-b = Ctrl + b
#
# *** WINDOWS ***
# CREATE NEW WINDOW: C-b + c
# CHOOSE WINDOW FROM LIST: C-b + w
# SWITCH TO WINDOW NUMBER: C-b + 0
# MOVE TO PREVIOUS WINDOW: C-b + p
# MOVE TO NEXT WINDOW: C-b + n
# NAME CURRENT WINDOW: C-b + ,
#
# *** PANES ***
# NAVIGATING PANES: C-b + [Arrow Keys]
# SPLIT LEFT/RIGHT: C-b + %
# SPLIT UP/DOWN: C-b + "
# NEXT PANE: C-b + o
# TOGGLE RECENT PANES: C-b + ;
# CLOSE PANE (with prompt): C-b + x
# CLOSE PANE (1): C-d
# CLOSE PANE (2): exit
#
# *** SESSIONS ***
# - Detach = Leave what you are doing in that session running in the background.
# - $ tmux ls --> List all running sesssions.
# - $ tmux attach -t 0 --> Connect back to the "0" session.
# - $ tmux new -s <session_name> --> Give sessions a meaningful name.
# - $ tmux rename-session -t <current_session_name> <session_name> --> Rename your existing session.
# DETACH CURRENT SESSION: C-b + d
# DETACH SESSION FROM LIST: C-b + D
#
# *** COMMON COMMANDS ***
# - Make a pane go full screen: C-b + z
# - Shrink a pane back to its original size: C-b + z (again)
# - Resize pane in direction of <arrow key>: C-b + C-<arrow key>
# - Rename the current window: C-b + ,
#
# *** SCROLLING ***
# - Enter scroll mode (Can navigate with arrow keys): C-b + [
# - Quitting scroll mode: q
# What is the difference between 'screen-256color' and 'tmux-256color'
# https://github.com/gpakosz/.tmux
# Allowing tmux-256color to work in tmux.
# tmux-256color, xterm-256color, screen-256color
# https://unix.stackexchange.com/questions/1045
set -g default-terminal 'tmux-256color'
# Remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# "Remap Caps Lock to Ctrl"
# Split panes using \ and -
# New pane split will be in current directory.
bind \\ split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
unbind '"'
unbind %
# Switch panes using Alt-arrow without prefix
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# Enable mouse control (clickable windows, panes, resizable panes)
# set -g mouse on
# Don't rename windows automatically
set-option -g allow-rename off