-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
103 lines (77 loc) · 3.12 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
# improve color
set -g default-terminal "screen-256color"
# act like vim
setw -g mode-keys vi
# 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"
# Easier window splitting
bind - split-window -v -c '#{pane_current_path}'
bind / split-window -v -c '#{pane_current_path}'
bind \\ split-window -h -c '#{pane_current_path}'
# bind-key -n C-\\ split-window -h -c '#{pane_current_path}'
# bind-key -n C-_ split-window -v -c '#{pane_current_path}'
bind . split-window -h -c '#{pane_current_path}'
# More natural window switching
unbind c
bind t new-window -c '#{pane_current_path}'
unbind h
bind h previous-window
unbind l
bind l next-window
# 1-based window indexing
set -g base-index 1
set -g renumber-windows on
# Custom prefix
unbind C-b
set-option -g prefix C-s
bind-key C-s send-prefix
# Larger history limit
set -g history-limit 4096
# Refresh with prefix-r
bind-key r source-file ~/.tmux.conf \; display-message "Config file loaded"
# Add mouse support
set -g mouse on
# soften status bar color from harsh green to light gray
set -g status-style bg='#333333',fg='#aaaaaa'
set -g pane-active-border-style fg=blue
set-window-option -g window-status-current-style bg=blue,fg='#ffffff'
#set inactive/active window styles
set -g window-active-style fg=colour15,bg=colour0
set -g window-style fg=colour247,bg=colour236
# set the pane border colors
set -g pane-active-border-style fg=blue,bg=black
set -g pane-border-style fg=colour250,bg=colour236
# remove administrative debris (session name, hostname, time) in status bar
set -g status-left ''
set -g status-right '#{prefix_highlight}'
# Remove escape key lag
set -sg escape-time 0
# https://robots.thoughtbot.com/tmux-copy-paste-on-os-x-a-better-future
# Use vim keybindings in copy mode
setw -g mode-keys vi
# Setup 'v' to begin selection as in Vim
bind-key -Tcopy-mode-vi v send -X begin-selection
bind-key -Tcopy-mode-vi y send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
# Update default binding of `Enter` to also use copy-pipe
unbind -Tcopy-mode-vi Enter
bind-key -Tcopy-mode-vi Enter send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
unbind [
bind-key q copy-mode
# Neovim healthcheck suggestions
set-option -g focus-events on
set-option -sa terminal-features ',xterm-kitty:RGB'
# Plugins
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
set -g @prefix_highlight_show_copy_mode 'on'
set -g @prefix_highlight_copy_mode_attr 'fg=white,bg=yellow,bold'
set -g @plugin 'nhdaly/tmux-better-mouse-mode'
set -g @emulate-scroll-for-no-mouse-alternate-buffer 'on' # Doesn't work ?
set -g @scroll-speed-num-lines-per-scroll '5'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'