-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
86 lines (66 loc) · 3.07 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
# Set prefix to space.
unbind C-b
set -g prefix C-Space
# General options
set -g history-limit 100000
set -g base-index 1
set -g pane-base-index 1
# 256 color support
set -g default-terminal "tmux-256color"
# Add Truecolor support
#set -ga terminal-overrides ",xterm-256color:Tc"
set -ga terminal-overrides ",*256col*:Tc"
# Use reattach-to-user-namespace for copy mode on macOS using Tmux <= version 2.5
#set -g default-shell $SHELL
#set -g default-command "reattach-to-user-namespace -l ${SHELL}"
## Allows for faster key repetition
set -sg escape-time 0
# Enable mouse scrolling
set -g mouse on
bind -T copy-mode-vi C-y send -X scroll-up
bind -T copy-mode-vi WheelUpPane send -N2 -X scroll-up
bind -T copy-mode-vi C-e send -X scroll-down
bind -T copy-mode-vi WheelDownPane send -N2 -X scroll-down
# Stay in copy mode on drag end.
# (Would use `bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X
# stop-selection` but it is a bit glitchy.)
unbind-key -T copy-mode-vi MouseDragEnd1Pane
# Copy to pasteboard using iTerm2 with setting "Applications in terminal may access clipboard"
#bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel pbcopy
# Copy to pasteboard using using reattach-to-user-namespace
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
bind-key -T copy-mode-vi Escape send -X cancel
bind-key -T copy-mode-vi 'V' send -X rectangle-toggle
# Copy to pasteboard using clipper on remote OpenBSD host (-N is required to shutdown(2) the network socket after EOF on the input)
#bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel "nc -U -N ~/.clipper.sock"
# Make double and triple click work outside of copy mode (already works inside it with default bindings).
#bind-key -T root DoubleClick1Pane if-shell -Ft{mouse} '#{alternate_on}' "send-keys -M" "copy-mode -t{mouse}; send-keys -t{mouse} -X select-word"
#bind-key -T root TripleClick1Pane if-shell -Ft{mouse} '#{alternate_on}' "send-keys -M" "copy-mode -t{mouse}; send-keys -t{mouse} -X select-line"
# Fast toggle between current and last-used window (normally prefix-l).
bind ^space last-window
# Dynamically update iTerm tab and window titles.
set -g set-titles on
# Automatically renumber window numbers on closing a pane (tmux >= 1.7).
set -g renumber-windows on
# Set the non-word characters for word boundaries (default is ‘ -_@’)
set-option -ga word-separators :/
# Split windows like Vim
# Vim's definition of a horizontal/vertical split is reversed from tmux's
bind s split-window -v
bind v split-window -h
# Vim navigation key bidings
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Resize panes like vim
# - change the adjustment number to the number of lines/cells you want to resize to
bind < resize-pane -L 1
bind > resize-pane -R 1
bind - resize-pane -D 1
bind + resize-pane -U 1
# vi-style controls for copy mode
setw -g mode-keys vi
#if-shell "test -f ~/.tmux-style-solarized" "source ~/.tmux-style-solarized"
if-shell "test -f ~/.tmux-style-monokai" "source ~/.tmux-style-monokai"