-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
101 lines (86 loc) · 3.08 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
#set keyboard shortcut to ctrl-g
unbind C-b
set -g prefix C-g
bind C-g send-prefix
bind g send-prefix
# nested sessions need different bind key
#bind-key -n C-a send-prefix
# encoding
set -g default-terminal "screen-256color"
set-option -g default-shell $SHELL
set -g @shell_mode 'vi'
# scrolling
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
# Highlight active window
set-window-option -g xterm-keys on
#set status bar options
set -g mode-style bg='#4e4e4e',fg='#ffffff'
set -g window-status-current-style bg='#55ff55',fg='#000000'
#rename windows only manually
bind + new-window -d -n tmux-zoom 'clear && echo TMUX ZOOM && read' \; swap-pane -s tmux-zoom.0 \; select-window -t tmux-zoom
unbind -
bind - last-window \; swap-pane -s tmux-zoom.0 \; kill-window -t tmux-zoomoff
# copy paste
bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel “reattach-to-user-namespace pbcopy”
# Set window notifications
setw -g monitor-activity on
set -g visual-activity on
#bind keys for visual selection across panes
setw -g mode-keys vi
# Vim style
unbind-key j
bind-key j select-pane -D # Similar to 'C-x j' to navigate windows in Vim
unbind-key k
bind-key k select-pane -U
unbind-key h
bind-key h select-pane -L
unbind-key l
bind-key l select-pane -R
#smart pane switching with awareness of vim splits
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind-key -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"
#set scroll back buffer
set -g history-limit 10000
set -g base-index 1
#tmux mouse mode name varies across versions.
#>=2.1
set -g mouse on
#<2.1
#setw -g mode-mouse on
#setw -g mouse-select-pane on
#setw -g mouse-resize-pane on
#setw -g mouse-select-window on
# Toggle mouse on with ^B m
bind m \
setw -g mode-mouse on \;\
setw -g mouse-resize-pane on \;\
setw -g mouse-select-pane on \;\
setw -g mouse-select-window on \;\
display 'Mouse: ON'
# Toggle mouse off with ^B M
bind M \
setw -g mode-mouse off \;\
setw -g mouse-resize-pane off \;\
setw -g mouse-select-pane off \;\
setw -g mouse-select-window off \;\
display 'Mouse: OFF'
unbind r
bind r source-file ~/.tmux.conf
setw -g window-status-current-format '#{?pane_synchronized,#[bg=red],}#I:#W'
setw -g window-status-format '#{?pane_synchronized,#[bg=red],}#I:#W'
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
set-option -ga terminal-overrides ',*:enacs@:smacs@:rmacs@:acsc@'
set -s escape-time 0
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'jbnicolai/tmux-fpp'
set -g @plugin 'tmux-plugins/tmux-yank'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'