-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.tmux.conf
More file actions
68 lines (50 loc) · 3.48 KB
/
Copy path.tmux.conf
File metadata and controls
68 lines (50 loc) · 3.48 KB
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
#====================================================
# TMUX Configuration
#
# This script provides useful TMUX configuration settings.
#====================================================
# Enable Vi mode in tmux such that a buffer can be navigated in the same manner as in Vi using Vi-like bindings.
set-window-option -g mode-keys vi
# Start window numbering at 1 so that it's easier to navigate between the first window, at index 1, and the others, beginning at 2 and proceeding from there.
set-option -g base-index 1
# Renumber all windows sequentially when any window is closed.
set -g renumber-windows on
# Set the timeout associated with waiting for characters entered after escape, <ESC>, to zero. This removes the delay between pressing <ESC>, followed by a second character as part of a command sequence, before it's recognized as a command by tmux. Therefore, tools like vim, which relies on <ESC> to indicate the desire of the user to transition from one mode (INSERT) to another (NORMAL), will receive the <ESC> key press event immediately, instead of with a delay.
set -s escape-time 0
# Enable aggressive resizing of windows. Instruct tmux to only constrain a window to the size of the smaller client that is actively looking at it.
set-window-option -g aggressive-resize on
# Enable or disable the ability to synchronize input across all window panes. This allows input to one window pane to be pushed to all currently visible window panes.
bind e setw synchronize-panes on
bind E setw synchronize-panes off
# Set the tmux window title to print the connection string of the host that the user is currently connected to.
set-option -g set-titles on
set-option -g set-titles-string "#T"
# Enable mouse support within tmux.
set-option -g mouse on
# Smart pane switching with awareness of vim splits
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?x?)(diff)?$"'
bind -n M-h if-shell "$is_vim" "send-keys M-h" "select-pane -L"
bind -n M-j if-shell "$is_vim" "send-keys M-j" "select-pane -D"
bind -n M-k if-shell "$is_vim" "send-keys M-k" "select-pane -U"
bind -n M-l if-shell "$is_vim" "send-keys M-l" "select-pane -R"
# Set scroll back history so that the last 10,000 lines of output are remembered.
set-option -g history-limit 10000
# Un-bind the default key used for splitting a window vertically into multiple panes.
unbind %
# Bind GNU Screen-like keys for splitting vertically, v, and horizontally, h.
bind | split-window -h
bind - split-window -v
# Enable notifications within tmux when there is activity within a window pane.
set-window-option -g monitor-activity on
set-option -g visual-activity on
# Automatically rename a window to the name of the command that is currently running within it.
set-window-option -g automatic-rename on
# Enabled xterm key sequences for key sequences such as CTRL+arrow. This allows tmux to pass through CTRL modifiers to function keys using xterm-style key sequences.
set-window-option -g xterm-keys on
# Configure TMUX to set the $TERM environmental variable to specifically indicate that the terminal container supports 256 color.
set -g default-terminal "screen-256color"
# Remove the border style applied by tmux to indicate an active pane. By changing a pane's background color, we can more easily distinguish between active and non-active panes.
set-window-option -g pane-active-border-style ''
# Configure TMUX to use the same shell that invoked the TMUX process.
set-option -g default-shell $SHELL