-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
88 lines (77 loc) · 3.51 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
86
87
88
### DTHER'S TMUX DOTFILE ###
# (c) Rudy Dellomas III
## General settings ##
set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q'
set -g default-terminal "tmux-256color"
# change prefix
set-option -g prefix C-a
bind -N 'Send the prefix key' C-a send-prefix
# Increase to 200? if working remotely
# Shouldn't really matter since direction keys arent bound to anything
set -s escape-time 10
# hot-reload config file
bind -N 'Reload ~/.tmux.conf' r source-file ~/.tmux.conf \; \
display-message "Config loaded!"
# kill session (after asking)
bind -N 'Kill current session' Q confirm-before -p "kill-session #S? (y/n)" kill-session
## Vim-Window style Pane management ##
# Changes tmux's pane management to be similar but not the same as vim windows.
# switch panes vim-style
# only l is used for anything and would probably be fine with being rebound to Tab
bind -N 'Select the pane to the left' h select-pane -L
bind -N 'Select the pane below' j select-pane -D
bind -N 'Select the pane above' k select-pane -U
bind -N 'Select the pane to the right' l select-pane -R
bind -N 'Return to last window' Tab last-window
# holding CTRL still works, like in vim
bind -N 'Select the pane to the left' C-h select-pane -L
bind -N 'Select the pane below' C-j select-pane -D
bind -N 'Select the pane above' C-k select-pane -U
bind -N 'Select the pane to the right' C-l select-pane -R
# Rebind c to kill panes, instead of create windows.
bind -N 'Kill the active pane' c confirm-before -p "kill-pane #P? (y/n)" kill-pane
# Create new windows with n and switch to the last active window with p
# While n and p sound useful, why cycle when you can fly?
# Use C-a <number> or C-a ' to jump by window index,
# Or even C-a w to jump across sessions
bind -N 'New window' n new-window
bind -N 'Select previous (last used) window' p last-window
# why are splitting panes % and "? feels almost random aside from
# *maybe* the shape of % and ". And even then it's a stretch.
# NOTE: vim and tmux use opposite terminology when referring to a "horizontal" split.
bind -N 'Split a pane across its height' s split-pane
bind -N 'Split a pane across its width' v split-pane -h
# Rebind x and z to be used to move things up and down the pane stack.
# Not quite the same as vim, but close enough for quick management.
# NOTE: maybe start doing this for dwm as well... Hmmm.
bind -N 'Swap with the pane below.' x swap-pane -D
bind -N 'Swap with the pane above.' z swap-pane -U
## Copy-Mode Stuff ##
# Copy-mode vi keys, decent default
set-window-option -g mode-keys vi
# enter copymode with C-a Esc because [ is a pinky stretch
bind -N 'Enter copy mode' Escape copy-mode
# Make selection more vim-like
# "V" already acts like it does in vim
# "v" should do what space does now
bind -N "Start selection" -T copy-mode-vi v {
send-keys -X rectangle-off
send-keys -X begin-selection
}
# "C-v" should be block selection (combo of what "v" and "space" does now)
bind -N "Start block selection" -T copy-mode-vi C-v {
send-keys -X rectangle-on
send-keys -X begin-selection
}
# "y" can be used to complete and copy selections
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel
# almost Vim-style paste buffer management
bind -N 'Choose a paste buffer from a list' '"' choose-buffer
# xclip integration?
set copy-command 'xclip -selection "clip-board"'
## Misc ##
# I don't bother with mouse, because generally if I want to use the mouse,
# I'm trying to primary selection/copy-paste something into the browser.
#set -g mouse on
# Change the window title- useful for window switching
set -g set-titles 'on'