-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
61 lines (54 loc) · 2.22 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
# vi is good
setw -g mode-keys vi
# mouse behavior
#setw -g mouse on
# make scrolling with wheels work
#bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
#bind -n WheelDownPane select-pane -t= \; send-keys -M
set-option -g default-shell /usr/bin/zsh
#set-option -g default-terminal screen-256color
# use vim-like keys for splits and windows
bind-key v split-window -h
bind-key s split-window -v
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
# selecting pane vim style, considering fzf
#is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
# | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
#
#is_fzf="ps -o state= -o comm= -t '#{pane_tty}' \
# | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?fzf$'"
#
#bind -n C-h run "($is_vim && tmux send-keys C-h) || \
# tmux select-pane -L"
#
#bind -n C-j run "($is_vim && tmux send-keys C-j) || \
# ($is_fzf && tmux send-keys C-j) || \
# tmux select-pane -D"
#
#bind -n C-k run "($is_vim && tmux send-keys C-k) || \
# ($is_fzf && tmux send-keys C-k) || \
# tmux select-pane -U"
#
#bind -n C-l run "($is_vim && tmux send-keys C-l) || \
# tmux select-pane -R"
#
#bind-key -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
# vim-style copy mode considering changes in V2.4. check tmux -V
run-shell "tmux setenv -g TMUX_VERSION $(tmux -V | cut -c 6-)"
if-shell -b '[ "$(echo "$TMUX_VERSION < 2.4" | bc)" = 1 ]' \
"bind-key Escape copy-mode; \
bind-key -t vi-copy Escape cancel; \
bind-key p paste-buffer; \
bind-key -t vi-copy v begin-selection; \
bind-key -t vi-copy V select-line; \
bind-key -t vi-copy r rectangle-toggle; \
bind -t vi-copy y copy-pipe 'xclip -in -selection clipboard'"
if-shell -b '[ "$(echo "$TMUX_VERSION >= 2.4" | bc)" = 1 ]' \
"bind-key -T copy-mode-vi 'v' send -X begin-selection; \
bind-key -T copy-mode-vi 'V' send -X select-line; \
bind-key -T copy-mode-vi 'r' send -X rectangle-toggle; \
bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel 'xclip -in -selection clipboard'"
set -g history-limit 50000