-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
119 lines (92 loc) · 5.27 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
################################################################################
# Styling #
################################################################################
# Messages
set -g message-style fg=yellow,bg=black,bold # Style
# Panes
set -g pane-active-border-style fg=yellow # Active pane border color
set -g pane-border-style fg=brightblack # Pane border color
set -g pane-border-format '' # Clear the border content
set -g pane-border-status top # Add a status line border
# Status line
set -g status-bg default # Status background color
set -g status-fg brightwhite # Status foreground color
set -g status-interval 1 # Update the status every second
set -g status-justify left # Justify the status on the left
set -g status-left '#[fg=yellow,bold]#S#[fg=default] · '
set -g status-left-length 20 # Left status string max length
set -g status-position top # Position the status on the top
set -g status-right '#{?client_prefix,#[bg=red#,fg=black#,bold] PREFIX #[bg=default#,fg=default#,nobold],} %a %d %b %H:%M'
set -g status-right-length 100 # Right status string max length
# Windows
setw -g window-status-current-style fg=white,bold # Active window
setw -g window-status-current-format '#I:#W#F' # Window text format
setw -g window-status-style fg=brightwhite # Window foreground color
# 256 color support
set -g default-terminal "screen-256color"
################################################################################
# Settings #
################################################################################
# Accessibility
set -g focus-events on # Enable focus events
set -g history-limit 10000 # Maximum number of lines in history
set -g mouse on # Allow the use of the mouse
set -sg escape-time 0 # Remove the delay after pressing escape
set-option -g display-time 2000 # Display messages for 2 seconds
# Navigation
set -g status-keys vi # Use vi-style key bindings in the status line
setw -g mode-keys vi # Use vi-style key bindings in choice modes
# Panes
setw -g pane-base-index 1 # Start numbering at 1
# Terminal
set -g set-titles on # Set the terminal title
set -g set-titles-string '#S' # Use the session name as the title
setw -g aggressive-resize on # Resize the window to the smallest session
# Time
setw -g clock-mode-style 24 # Set the clock format to 24h
# Windows
set -g base-index 1 # Start numbering at 1
set -g renumber-windows on # Renumber windows on window close
setw -g automatic-rename on # Automatically rename the window
################################################################################
# Mappings #
################################################################################
# Prefix
unbind C-b # Remove the default prefix
set -g prefix C-Space # Set ctrl + space as the prefix
bind C-Space send-prefix # Set ctrl + space as the prefix
# Panes
bind - split-window -v -c '#{pane_current_path}' # Create a horizontal split
bind '\' split-window -h -c '#{pane_current_path}' # Create a vertical split
bind-key x kill-pane
# Source
bind R source-file ~/.tmux.conf \; display 'Configuration reloaded.'
# Windows
bind c new-window -c '#{pane_current_path}'
bind e setw synchronize-panes on
bind E setw synchronize-panes off
################################################################################
# Plugins #
################################################################################
set -g @plugin 'christoomey/vim-tmux-navigator' # Seamless tmux-vim navigation
set -g @plugin 'tmux-plugins/tmux-resurrect' # Environment persisting
set -g @plugin 'tmux-plugins/tmux-yank' # Clipboard access
## Copy mouse
set -g mouse on
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
bind -n WheelDownPane select-pane -t= \; send-keys -M
bind -n C-WheelUpPane select-pane -t= \; copy-mode -e \; send-keys -M
bind -T copy-mode-vi C-WheelUpPane send-keys -X halfpage-up
bind -T copy-mode-vi C-WheelDownPane send-keys -X halfpage-down
bind -T copy-mode-emacs C-WheelUpPane send-keys -X halfpage-up
bind -T copy-mode-emacs C-WheelDownPane send-keys -X halfpage-down
# To copy, left click and drag to highlight text in yellow,
# once you release left click yellow text will disappear and will automatically be available in clibboard
# # Use vim keybindings in copy mode
setw -g mode-keys vi
# Update default binding of `Enter` to also use copy-pipe
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "pbcopy"
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy"
# Initialize
run '~/.tmux/plugins/tpm/tpm'