-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtmux.conf
More file actions
71 lines (53 loc) · 2.51 KB
/
tmux.conf
File metadata and controls
71 lines (53 loc) · 2.51 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
# This file serves as tmux.conf, as well as notes on how to run/use tmux
# should get symlinked to ~/.tmux.conf
#
# tmux new # start new session, default #'d name
# tmux new -s mdos_session # start new session named 'mdos_session'
# CTRL-b d # detach from current session
# tmux ls | list-sessions # list active sessions
# tmux at <#> # attach to session # (usually 0-indexed)
# tmux attach -t mdos_session # re-attach to named session
# tmux kill-session <#> # kill a session
# tmux kill-session -t <name> # kill a session
# CTRL-b % # split current pane vertical
# CTRL-b " # split current pane horizontal
# CTRL-b <Up><Dn><Left><Right> # Move to pane
#
# tmux.conf section
# 256 colors for vim
set -g default-terminal "screen-256color"
# start window numbering at 1
#set-option -g base-index 1
#set-window-option -g pane-base-index 1
# Cycle panes with C-b C-b
unbind ^B
bind ^B select-pane -t :.+
# Reload config with one key
bind-key r source-file ~/.tmux.conf \; display "Config reloaded!"
# Mouse config
set -g mode-mouse on
set -g mouse-select-pane on
set -g mouse-resize-pane on
set -g mouse-select-window on
# Scrolling
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
# use sys clipboard
set-option -g default-command "reattach-to-user-namespace -l bash"
# clear pane and history
bind -n C-k send-keys C-l \; clear-history
# smart vim aware pane switch
#bind -n C-h run "(tmux display-message -p '#{pane-current-command}' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L"
#bind -n C-j run "(tmux display-message -p '#{pane-current-command}' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D"
#bind -n C-k run "(tmux display-message -p '#{pane-current-command}' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U"
#bind -n C-l run "(tmux display-message -p '#{pane-current-command}' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R"
#bind -n C-\ run "(tmux display-message -p '#{pane-current-command}' | grep -iq vim && tmux send-keys C-\\) || tmux select-pane -l"
# C-l taken over by vim style nav
bind C-l send-keys 'C-l'
# Vim keybindings in copy mode
setw -g mode-keys vi
# Setup 'v' to begin selection as in vim
bind-key -t vi-copy v begin-selection
bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
# Default binding of 'Enter' includes copy-pipe
unbind -t vi-copy Enter
bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"