Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
aos
GitHub Repository: aos/dotfiles
Path: blob/master/files/tmux.conf
245 views
1
# Remap prefix from 'C-b' to 'C-a'
2
unbind C-b
3
set -g prefix C-a
4
# Pressing C-a again will send the prefix (useful for nested sessions)
5
bind-key C-a send-prefix
6
7
# Send command to all tmux panes (toggle on/off)
8
bind C-s setw synchronize-panes
9
10
# Start window numbering at 1
11
set -g base-index 1
12
13
# split panes using | and -
14
bind | split-window -h -c "#{pane_current_path}"
15
bind - split-window -v -c "#{pane_current_path}"
16
unbind c
17
bind c new-window -c "#{pane_current_path}"
18
unbind '"'
19
unbind %
20
21
# Navigate split panes the vim way
22
bind h select-pane -L
23
bind j select-pane -D
24
bind k select-pane -U
25
bind l select-pane -R
26
27
# More vim bindings for copy/paste
28
# Enter copy mode using Prefix + [ and start copy using <Space> (q to exit)
29
# Execute copy using Enter
30
# Prefix + ] to paste
31
setw -g mode-keys vi
32
# Begin selection in copy mode
33
bind-key -T copy-mode-vi v send-keys -X begin-selection
34
# Begin selection visual block
35
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
36
# Yank selection and into system clipboard
37
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xclip -sel clip -i"
38
39
unbind-key -T copy-mode-vi H
40
bind-key -T copy-mode-vi H send -X start-of-line
41
unbind-key -T copy-mode-vi L
42
bind-key -T copy-mode-vi L send -X end-of-line
43
44
# Color highlighting in copy-mode
45
setw -g mode-style "fg=black,bg=colour178"
46
47
# Easy reloading source file
48
bind R source-file ~/.tmux.conf
49
50
# Mouse mode keys
51
bind-key m set-option mouse \; display-message "mouse #{?mouse,on,off}"
52
53
# 'Tc' allows true color within vim, 'sitm' allows the same with italics
54
#set-option -sa terminal-overrides ',xterm*:RGB'
55
set -as terminal-overrides ',xterm*:Tc:sitm=\E[3m'
56
57
# Set default terminal mode to 256 color
58
set -g default-terminal "tmux-256color"
59
60
# Enable activity alerts
61
setw -g monitor-activity on
62
set -g visual-activity off
63
64
# neovim in tmux causes delay when pressing ESC, let's reduce it
65
set -g escape-time 0 # ms
66
67
# Create a new window and prompt for name
68
bind C command-prompt "new-window -n '%%'"
69
# Don't rename windows automatically
70
set -g allow-rename off
71
# Re-number windows automatically
72
set -g renumber-windows on
73
74
# Increase the history limit scrollback buffer
75
set -g history-limit 5000
76
77
## Status bar
78
# Colors
79
set -g status-bg black
80
set -g status-fg white
81
## Left
82
set -g status-left "#[fg=white, bg=black][#S] #h"
83
set -g status-left-length 15
84
## Center
85
set -g status-justify centre # Center window list for clarity
86
## Right
87
set -g status-right-length 35
88
set -g status-right "%a %b %d ┆ %I:%M %p"
89
90
## Window names
91
# setw -g window-status-format " #I:#W#F "
92
# setw -g window-status-current-format " #I: #W#F "
93
setw -g window-status-format "#[fg=magenta] #I | #[fg=white]#W#[fg=magenta]#F "
94
setw -g window-status-current-format "#[fg=brightwhite] #I | #[fg=colour195]#W#[fg=brightwhite]#F "
95
setw -g window-status-current-style "dim"
96
97
# Active window title style
98
setw -g window-status-style "bg=colour237"
99
setw -g window-status-current-style "fg=colour195, bg=colour232"
100
setw -g window-status-activity-style "bright"
101
102
## Panes
103
set -g pane-border-style "fg=black, bg=default"
104
set -g pane-active-border-style "fg=colour39"
105
106