-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
100 lines (75 loc) · 3 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
unbind-key C-b
set -g prefix C-a
bind -r C-a send-prefix
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tmux-plugins/tmux-yank'
# set -g @plugin 'Morantron/tmux-fingers'
# set -g @continuum-restore 'on'
set-window-option -g automatic-rename on
set-window-option -g main-pane-height 50
# MAIN_PANE_HEIGHT=$(expr $(tmux display -p '#{window_height}') / 3 \* 2)
# tmux resize-pane -t:.0 -y $MAIN_PANE_HEIGHT
set-option -g set-titles on
set -g monitor-activity on
# set -g utf8 on
# set -g status-utf8 on
# use vi key bindings
# setw -g mode-keys vi
# turn on mouse mode
setw -g mouse on
# bind -t vi-copy y copy-pipe "xclip -sel clip -i"
set-option -g base-index 1
set-window-option -g pane-base-index 1
set -g renumber-windows on
set -g window-active-style 'bg=black'
set -g window-style 'bg=colour235'
set -g display-panes-time 750
set -g default-shell /bin/zsh
set -g default-terminal 'xterm-256color'
set-option -g xterm-keys on
# set -g default-command /bin/zsh
# set -g default-terminal 'screen-256color'
# set -g status-keys vi
# setw -g mode-keys vi
# set-option -g focus-events off
set -g history-limit 10000
# vim escape mode delay
set -s escape-time 0
# Simplify status bar display.
set -g status-left-length 40
set -g status-fg green
set -g status-bg black
set -g status-left '[#S] '
set -g status-right "#{?pane_synchronized,--SYNCED--,} #(is-online) #(battery -t -g black) #(date '+%a, %b %d - %I:%M') "
is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n C-Left if-shell "$is_vim" "send-keys C-Left" "select-pane -L"
bind-key -n C-Down if-shell "$is_vim" "send-keys C-Down" "select-pane -D"
bind-key -n C-Up if-shell "$is_vim" "send-keys C-Up" "select-pane -U"
bind-key -n C-Right if-shell "$is_vim" "send-keys C-Right" "select-pane -R"
# Make C-j display a selectable list of sessions
# bind C-j choose-tree
bind C-j split-window -v "tmux list-sessions | sed -E 's/:.*$//' | grep -v \"^$(tmux display-message -p '#S')\$\" | fzf --reverse | xargs tmux switch-client -t"
# Quick session switching back and forth. I never use the built in layouts
# (default mapping for Space), so I reclaimed the key for this
bind-key Space switch-client -l
# more intuitive keybindings for splitting
# bind \ split-window -h -c "#{pane_current_path}"
# bind - split-window -v -c "#{pane_current_path}"
bind Up split-window -b -v
bind Down split-window -v
bind Left split-window -b -h
bind Right split-window -h
# bind resizing of panes to H,J,K,L (resizes by steps of 10 lines/columns)
# bind -n S-Left resize-pane -L 2
# bind -n S-Right resize-pane -R 2
# bind -n S-Down resize-pane -D 1
# bind -n S-Up resize-pane -U 1
bind -n C-H resize-pane -L 20
bind -n C-L resize-pane -R 20
bind -n C-J resize-pane -D 10
bind -n C-K resize-pane -U 10
# Reload tmux.conf with prefix-r
bind C-l source-file ~/.tmux.conf \; display "Reloaded ~/.tmux.conf"
run '~/.tmux/plugins/tpm/tpm'