-
Notifications
You must be signed in to change notification settings - Fork 3
/
.tmux.conf
94 lines (82 loc) · 3.97 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
#set -g default-shell /Users/mark/.cargo/bin/nu
# Session options
# reduce time tmux waits to send commands after an escape is input
#set -sg escape-time 1
set -sg escape-time 0
# Window options
# allow multiple clients to display windows from the same session in different sizes
setw -g aggressive-resize on
setw -g mode-keys vi # enable vi keys for working with buffers
# watch for activity in windows so it can be indicated in the status bar
# (see visual-activity option below)
setw -g monitor-activity on
setw -g renumber-windows on
setw -g window-status-current-style bg=magenta # in status bar
# Prefix key
set -g prefix C-a # instead of default C-b
unbind C-b # don't want two prefix keys
bind C-a send-prefix # press C-a twice to send to an app
# Key bindings
bind c new-window \; command-prompt "rename-window '%%'"
bind r source-file ~/.tmux.conf \; display "reloaded" # reload this file
# The line above replaces the default binding to the "refresh-client" command.
bind | split-window -h -c "#{pane_current_path}" # in addition to %
bind - split-window -v -c "#{pane_current_path}" # in addition to "
# To clear a pane
# This conflicts with your Vim key mapping for ALE.
#bind -n C-k send-keys "clear"\; send-keys "Enter"
# To resize the current in increments of 5 columns/rows
bind -r C-Left resize-pane -L 5
bind -r C-Right resize-pane -R 5
bind -r C-Up resize-pane -U 5
bind -r C-Down resize-pane -D 5
# To simplify movement between tmux panes and Vim splits
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'
tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'"
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
"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
bind C-l send-keys 'C-l' # ctrl-l ctrl-l sends ctrl-l
# Mouse options
set -g mouse on # allow use of mouse
# Color customizations
# TODO: Can hex colors be specified?
# TODO: Can pane border character be changed to a Unicode character?
set -g default-terminal "tmux-256color-italic" # use 256 colors instead of 16
set-option -ga terminal-overrides ",xterm-256color-italic:Tc"
# When running in an xterm started from Cygwin,
# delete the terminal-overrides line and
# change the line before it that sets default-terminal to use "screen".
set -g pane-border-style fg=yellow # default is "default" which is gray
set -g pane-active-border-style fg=red # default is green
# Status bar
set -g status-bg blue # default is green
set -g status-fg white # default is black
set -g status-interval 60 # update status bar every 60 seconds
set -g status-justify centre # display window list in center of status bar
set -g status-left "session #S window #I"
set -g status-left-length 40
#set -g status-right "#h %a %m/%d/%y" # hostname, day abbrev., month, day, year
set -g status-right "%a %m/%d/%y" # day abbrev., month, day, year
set -g status-right-length 15 #45
set -g visual-activity on # highlight window names in status bar on activity
#set-window-option -g pane-base-index 1 # start pane indexes at 1 instead of 0
#set -g base-index 1 # start window indexes at 1 instead of 0
# Setup plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/vim-tmux-navigator'
run '~/.tmux/plugins/tpm/tpm'
# Fig Tmux Integration: Enabled
#source-file ~/.fig/tmux
# End of Fig Tmux Integration