forked from cahirwpz/mimiker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
80 lines (67 loc) · 2.81 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
# cat << EOF > /dev/null
# This file is a shell/tmux.conf polyglot
# https://en.wikipedia.org/wiki/Polyglot_(computing)
# default <prefix> is <ctrl>+b
# <prefix> + m enable/disable mouse scroll
# <prefix> + Ener copy mode
# <prefix> + [ copy mode
# <prefix> + b list paste buffers
# <prefix> + p paste from the top paste buffer
# <prefix> + P choose which buffer to paste from
# <prefix> + B save selection to file. interactive command.
#
# default settings can be overriden in .tmux.conf.local file
set exit-unattached off
set exit-empty off
set -g status-position top
set -g default-terminal "screen-256color"
set -g mouse off
setw -g xterm-keys on # If this option is set, tmux will generate xterm(1)-style
# function key sequences; these have a number included to
# indicate modifiers such as Shift, Alt or Ctrl.
set -g status-keys vi # Use vi-style key bindings in the status line.
set -g mode-keys vi # Use vi-style key bindings in copy mode.
# toggle mouse
bind m run "cut -c3- $MIMIKER_REPO/.tmux.conf | sh -s _toggle_mouse"
# -- copy mode -----------------------------------------------------------------
bind Enter copy-mode # enter copy mode. also [
run -b 'tmux bind -t vi-copy v begin-selection 2> /dev/null || true'
run -b 'tmux bind -T copy-mode-vi v send -X begin-selection 2> /dev/null || true'
run -b 'tmux bind -t vi-copy C-v rectangle-toggle 2> /dev/null || true'
run -b 'tmux bind -T copy-mode-vi C-v send -X rectangle-toggle 2> /dev/null || true'
run -b 'tmux bind -t vi-copy y copy-selection 2> /dev/null || true'
run -b 'tmux bind -T copy-mode-vi y send -X copy-selection-and-cancel 2> /dev/null || true'
run -b 'tmux bind -t vi-copy Escape cancel 2> /dev/null || true'
run -b 'tmux bind -T copy-mode-vi Escape send -X cancel 2> /dev/null || true'
run -b 'tmux bind -t vi-copy H start-of-line 2> /dev/null || true'
run -b 'tmux bind -T copy-mode-vi H send -X start-of-line 2> /dev/null || true'
run -b 'tmux bind -t vi-copy L end-of-line 2> /dev/null || true'
run -b 'tmux bind -T copy-mode-vi L send -X end-of-line 2> /dev/null || true'
# -- buffers -------------------------------------------------------------------
bind b list-buffers # list paste buffers
bind p paste-buffer # paste from the top paste buffer
bind P choose-buffer # choose which buffer to paste from
bind-key B command-prompt -p 'save last selection to:' -I 'tmux_dump' \
'save-buffer %1 ; delete-buffer'
# -- user defined overrides ----------------------------------------------------
source-file $MIMIKER_REPO/.tmux.conf.local
# EOF
# # Shell script begin
#
# set -e
#
# _toggle_mouse() {
# old=$(tmux show -gv mouse)
# new=""
#
# if [ "$old" = "on" ]; then
# new="off"
# else
# new="on"
# fi
#
# tmux set -g mouse $new \;\
# display "mouse: $new"
# }
#
# "$@"