-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
102 lines (81 loc) · 3.33 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
set-option -g detach-on-destroy off
set-option -g allow-rename off
set -g history-limit 30000
set -s escape-time 0
set -g base-index 1
setw -g mode-keys vi
#set -g default-command /usr/local/bin/zsh
#set-option -g default-shell /usr/local/bin/zsh
#set -g default-terminal screen-256color
#set -g default-shell $SHELL
#set -g default-command "reattach-to-user-namespace -l /usr/local/bin/zsh"
bind o previous-window
set -g assume-paste-time 0
# mouse mode and enable triggereing scoll when not in copy mode
set -g -q mouse on
#bind-key -T root WheelUpPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; copy-mode -e; send-keys -M"
#bind-key -T root WheelDownPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; send-keys -M"
# enable reattach for tmux vim copy paste on os x
#set-option -g default-command 'command -v reattach-to-user-namespace >/dev/null && exec reattach-to-user-namespace -l "$SHELL" || exec "$SHELL"'
## Itegrate vim tmux navigator
#is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?x?)(diff)?$"'
#bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
#bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
#bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
#bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
#bind -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
# pane navigation
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind > swap-pane -D # swap current pane with the next one
bind < swap-pane -U # swap current pane with the previous one
bind C-f command-prompt -p find-session 'switch-client -t %%'
# pane resizing
bind -r C-h resize-pane -L 5
bind -r C-j resize-pane -D 5
bind -r C-k resize-pane -U 5
bind -r C-l resize-pane -R 5
bind H resize-pane -L
bind J resize-pane -D
bind K resize-pane -U
bind L resize-pane -R
### KEYBINDINGS
## Copy-paste integration
unbind-key [
bind-key Escape copy-mode
bind-key -T copy-mode-vi 'v' send -X begin-selection
#bind -T copy-mode-vi 'y' send-keys -X copy-pipe "pbcopy"
#bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "pbcopy"
#bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy"
#bind-key -T copy-mode-vi DoubleClick1Pane \
# select-pane \; \
# send-keys -X select-word \; \
# send-keys -X copy-pipe "pbcopy"
#bind-key -n DoubleClick1Pane \
# select-pane \; \
# copy-mode -M \; \
# send-keys -X select-word \; \
# send-keys -X copy-pipe "pbcopy"
unbind p
bind p paste-buffer
# New window with default path set to last path
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
bind C new-session -c "#{pane_current_path}"
# STATUS BAR
# status bar colors
set -g status-bg default
set -g status-fg white
# alignment settings
set-option -g status-justify centre
#status left options
set-option -g status-left '#[fg=green][#[bg=black,fg=cyan]#S#[fg=green]]'
set-option -g status-left-length 20
# window settings
set-window-option -g window-status-format '#[fg=cyan,dim]#I#[fg=cyan]:#[default]#W#[fg=grey,dim]#F'
set-window-option -g window-status-current-format '#[fg=cyan,bold]#I#[fg=cyan]:#[bg=green,fg=black]#W#[fg=dim]#F'
# status right options
set -g status-right '[#[default]#(hostname)]'