-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
executable file
·131 lines (104 loc) · 4.43 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# # Remap prefix
unbind C-b
set -g prefix C-Space
# Quick key for moving back to the previous window
bind-key L last-window
bind -r k switch-client -l
# Vim style bindings for pane movement
# bind-key -r h select-pane -L
# bind-key -r j select-pane -D
# bind-key -r k select-pane -U
# bind-key -r 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-key -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
bind-key -T copy-mode-vi C-h select-pane -L
bind-key -T copy-mode-vi C-j select-pane -D
bind-key -T copy-mode-vi C-k select-pane -U
bind-key -T copy-mode-vi C-l select-pane -R
bind-key -T copy-mode-vi C-\ select-pane -l
# Fix issue with tmux repeating -r the arrow directions (meaning when you switch panes you can accidentally jump back to the other pane again)
# bind-key Up select-pane -U
# bind-key Down select-pane -D
# bind-key Left select-pane -L
# bind-key Right select-pane -R
# Make resizing panes easier
# bind-key < resize-pane -L 6
# bind-key > resize-pane -R 5
# bind-key + resize-pane -U 5
# bind-key - resize-pane -D 5
# bind-key = select-layout even-vertical
# bind-key | select-layout even-horizontal
# Resizing (mouse also works).
unbind Left
bind -r Left resize-pane -L 5
unbind Right
bind -r Right resize-pane -R 5
unbind Down
bind -r Down resize-pane -D 5
unbind Up
bind -r Up resize-pane -U 5
# Mouse can be used to select panes, select windows (by clicking on the status
# bar), resize panes. For default bindings see `tmux list-keys`.
set -g mouse on
# Intuitive window-splitting keys.
bind | split-window -h -c '#{pane_current_path}' # normally prefix-%
bind \ split-window -h -c '#{pane_current_path}' # normally prefix-%
bind - split-window -v -c '#{pane_current_path}' # normally prefix-"
# Reload tmux config
bind-key r source-file ~/.tmux.conf
# Disable footer status bar
set -g status on
# Status bar
set -g status-bg default
set -g status-fg white
set -g status-left-length 40
set -g status-left '#[fg=yellow]#S § ' # SECTION SIGN (UTF-8: c2 a7)
set -g status-right "#[fg=magenta]%l:%M %p"
set -g status-interval 60 # Default is 15.
# Ensure terminal starts with its own color scheme (helps Vim/Neovim themes to not break)
# set -g default-terminal "tmux"
# set -as terminal-overrides ',xterm*:sitm=\E[3m'
set -g default-terminal "xterm-256color"
set-option -ga terminal-overrides ',xterm-256color:Tc'
# Use Vi style key bindings to move around copy mode
setw -g mode-keys vi
# # Make sure messages (using display-message) are displayed for long enough to read
# set-option -g display-time 2000
# # Remove delay when pressing esc in Vim
# set -sg escape-time 0
# # Fix issue with copying from within a tmux session and wanting to paste outside of it
# set -g default-command "reattach-to-user-namespace -l '/usr/local/bin/zsh'"
# # Setup `v` and `y` operators to start and yank selections (like Vim)
# bind-key -t vi-copy 'v' begin-selection
# bind-key -t vi-copy 'y' copy-pipe "reattach-to-user-namespace pbcopy" # pbcopy is only available for Mac (not Linux)
# Use prefix C-l to clear the visible scrollback lines
bind C-l send-keys 'C-l'
# Use prefix C-k to clear the scrolled off (hidden) buffer lines
bind C-k clear-history
# # Prevent tmux from renaming the tab when processes change
# set-option -g allow-rename off
# # Set base index value to one (as apposed to zero)
# set -g base-index 1
# # Increase scrollback lines
# set -g history-limit 30000
# # Renumber windows automatically after removing a window
# # Prevents my OCD and means I don't have to manually run {move|swap}-window
# set-option -g renumber-windows on
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin '[email protected]/user/plugin'
# set -g @plugin '[email protected]/user/plugin'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'