-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.tmux.conf
executable file
·76 lines (62 loc) · 2.64 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
#TODO create version script with python/ruby/bash
# set the default TERM
set -g default-terminal screen
# update the TERM variable of terminal emulator when creating a new session or attaching a existing session
set -g update-environment 'DISPLAY SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY TERM'
# determine if we should enable 256-colour support
if "[[ ${TERM} =~ 256color || ${TERM} == fbterm ]]" 'set -g default-terminal screen-256color'
# Change default prefix to ctrl+x
unbind C-b
set -g prefix C-x
bind C-x send-prefix
# mouse controls
if "test $(echo -e \"$(tmux -V | cut -d' ' -f2)\n2.1\" |sort -rV |head -1) != 2.1" \
'set -g mouse on' \
'set -g mouse off'
setw -g alternate-screen on
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e'"
# vim-like keys for versions >= 2.4
setw -g mode-keys vi
set-window-option -g mode-keys vi
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind -n C-u if-shell "$is_vim" "send-keys C-u" "copy-mode -u"
bind -n C-d if-shell "$is_vim" "send-keys C-d" "send-keys Pagedown"
if "test $(echo -e \"$(tmux -V | cut -d' ' -f2)\n2.4\" |sort -rV |head -1) != 2.4" \
'bind-key -T copy-mode-vi "v" send -X begin-selection; \
bind-key -T copy-mode-vi "y" send -X copy-selection-and-cancel; \
bind-key -T copy-mode-vi "Space" send -X halfpage-down; \
bind-key -T copy-mode-vi "Bspace" send -X halfpage-up' \
'bind -t vi-copy "v" begin-selection; \
bind -t vi-copy "y" copy-selection; \
bind -t vi-copy "Space" halfpage-down; \
bind -t vi-copy "Bspace" halfpage-up'
# pane navigation
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
# rerun previous command in window 1
bind-key s select-pane -t 1 \; send-keys C-c Enter Up C-m \; last-pane
# urxvt tab like window switching (-n: no prior escape seq)
#bind-key -n S-down new-window
#bind-key -n S-left prev
#bind-key -n S-right next
#bind-key -n C-left swap-window -t -1
#bind-key -n C-right swap-window -t +1
#bind-key -n C-j detach
# terminal titles to update on server connections
set -g set-titles on
set -g set-titles-string "#T"
# Colorscheme
set -g @colors-solarized 'dark'
# Keep these last
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-pain-control'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'seebi/tmux-colors-solarized'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'