summaryrefslogtreecommitdiffstats
path: root/tmux.conf
blob: 4ef6deacc44397b0cf706e08b644774dd8426223 (plain) (blame)
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
# bells in any window get sent to the terminal
set  -g bell-action   any

# lots of scrollback
set  -g history-limit 4096

# use ^F rather than ^B for the prefix key
set  -g prefix        ^F

# hide the statusbar by default
set  -g status        off

# display window titles
set  -g set-titles    on

# keep windows in order
set  -g renumber-windows on

# use vi keybindings
setw -g mode-keys     vi
set  -g status-keys   vi

# colors
setw -g mode-bg       cyan
set  -g status-bg     blue
set  -g status-fg     green
set  -g message-bg    green

# fast escape
set -g escape-time 50

# keybindings
bind  f send-prefix
bind ^F run 'tmux choose-tree -Nwf"##{==:##{session_name},#{session_name}}"'
bind ^N new-window
bind ^D detach-client
bind ^[ copy-mode
bind { copy-mode
bind Enter run 'tmux capture-pane -p | perl -MURL::Search -E"say for URL::Search::extract_urls(do { local \$/; <> })" | tail -n1 | xargs xdg-open'

bind -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi ) send-keys -X start-of-line
bind -T copy-mode-vi _ send-keys -X back-to-indentation

bind -T copy-mode-vi y run "tmux send-keys -X copy-selection-and-cancel; tmux-clipboard copy primary"
bind -T copy-mode-vi ^C run "tmux send-keys -X copy-selection-and-cancel; tmux-clipboard copy clipboard"
bind y run "tmux-clipboard copy primary"
bind ^C run "tmux-clipboard copy clipboard"
bind IC run "tmux-clipboard paste primary"
bind ^V run "tmux-clipboard paste clipboard"

unbind ^B

# set up default sessions
new-session -s work -c "${HOME}/work"
new-session -s chat -c "${HOME}"
new-session -s main -c "${HOME}"
new-session -s docs -c "${HOME}"
new-session -s misc -c "${HOME}"