summaryrefslogtreecommitdiffstats
path: root/.tmux.conf
blob: 5b6d66f593757aaacb19f30b0c2443343fd27bfd (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
set -g default-command bash

setw -g automatic-rename off # no auto name
setw -g monitor-activity on
set -g visual-activity on

# set the first if running tmux version <=2.1; execute the second otherwise
if-shell '( echo "2.1"; tmux -V | cut -d" " -f 2; ) | sort -n | head -n 1 | grep -q "2\.1"' \
    'set -g mouse on' \
    'set -g mode-mouse on; set -g mouse-resize-pane on; set -g mouse-select-pane on; set -g mouse-select-window on'

set-option -g status-keys vi
set-option -g bell-action any
set-option -g visual-bell on
# set the first if running tmux version <=2.5; execute the second otherwise
if-shell '( echo "2.5"; tmux -V | cut -d" " -f 2; ) | sort -n | head -n 1 | grep -q "2\.5"' \
    'set -g activity-action other' \
    'set -g bell-on-alert on'

set -g history-limit 16000

# This configuration file binds many vi- and vim-like bindings to the
# appropriate tmux key bindings.  Note that for many key bindings there is no
# tmux analogue.  This is intended for tmux 1.3, which handles pane selection
# differently from the previous versions

# split windows like vim
# vim's definition of a horizontal/vertical split is reversed from tmux's
bind s split-window -v
bind v split-window -h

# move around panes with hjkl, as one would in vim after pressing ctrl-w
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R

bind Tab last-window
bind J command-prompt -p "join pane with:"  "join-pane -s '%%'"
bind S command-prompt -p "send pane to:"  "join-pane -t '%%'"
bind P command-prompt -p 'save history to filename:' -I '~/tmux.history' 'capture-pane -S -32768 ; save-buffer %1 ; delete-buffer'

# resize panes like vim
# feel free to change the "1" to however many lines you want to resize by, only
# one at a time can be slow
bind < resize-pane -L 1
bind > resize-pane -R 1
bind - resize-pane -D 1
bind + resize-pane -U 1

bind r source-file ~/.tmux.conf

# vi-style controls for copy mode
setw -g mode-keys vi

set -g set-titles on
set -g default-terminal "screen-256color"
# recommended settings for neovim: https://github.com/neovim/neovim/issues/1202
set -g escape-time 20           # time is in milliseconds

source-file ~/.tmux/tmuxline.conf

# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-open'
set -g @plugin 'NHDaly/tmux-scroll-copy-mode'

# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'