-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
134 lines (107 loc) · 4.02 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
###################
# charles
#
# Useful links:
# https://github.com/mathiasbynens/dotfiles/blob/master/.tmux.conf
# https://github.com/samoshkin/tmux-config/blob/master/tmux/tmux.conf
# https://github.com/tony/tmux-config/blob/master/scripts/resize-adaptable.sh
# https://stackoverflow.com/a/40009032
#
# Basic layout:
# - .tmux.conf contains tmux configuration variables
# - .tmux.sessionX contains tmux session setup (keyboard shortcut)
# - scripts/devtmux contains tmux session setup (named sessions)
set -g default-terminal "screen-256color"
set-option -g default-terminal screen-256color
# Use C-t instead
set-option -g prefix C-t
unbind C-t
bind C-t send-prefix
# Set parent terminal title to reflect current window in tmux session
set -g set-titles on
set -g set-titles-string "#I:#W"
# Start indexing of windows at 1, not 0
set -g base-index 1
setw -g pane-base-index 1
# Easy config reload
unbind r
bind R source-file ~/.tmux.conf \; display-message "tmux.conf reloaded."
# vi is good
setw -g mode-keys vi
bind : command-prompt
bind r refresh-client
bind space next-window
bind bspace previous-window
bind enter next-layout
# use vim-like keys for splits and windows
#
# Control-T plus:
#
# s = horizontal split
# v = vertical split
# h = pick left pane
# j = pick down pane
# k = pick up pane
# l = pick right pane
#
bind v split-window -h -c "#{pane_current_path}"
bind s split-window -v -c "#{pane_current_path}"
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# smart pane switching with awareness of vim splits
# (these interfere with the often-used Control-L shortcut
# to clear the screen, so that gets really annoying.)
#
# Control then:
#
# h = pick left pane
# j = pick down pane
# k = pick up pane
# l = pick right pane
#
# bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-h) || tmux select-pane -L"
# bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-j) || tmux select-pane -D"
# bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-k) || tmux select-pane -U"
# bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys C-l) || tmux select-pane -R"
# Control-T then Control-O swaps out windows in their respective positions
bind C-o rotate-window
# Control-T then + makes existing windows have vertical layout
bind + select-layout main-vertical
# Control-T then = makes existing windows have horizontal layout
bind = select-layout main-horizontal
# Control-T Control-N makes a new window in the path of the current pane
bind C-n new-window -c '#{pane_current_path}'
## (no idea what this does)
#set-window-option -g other-pane-height 25
#set-window-option -g other-pane-width 80
# Control-T plus [ or ] moves into copy mode or paste mode
bind [ copy-mode
bind ] paste-buffer
# (no idea)
set-window-option -g display-panes-time 1500
# Control-T plus | or _ splits panes vertically (|) or horizontally (_)
# (this is better than using percent, but now we've got muscle memory for %)
bind | split-window -h -c "#{pane_current_path}"
bind _ split-window -v -c "#{pane_current_path}"
# because we were using this before
bind % split-window -h -c "#{pane_current_path}"
# Status Bar
set-option -g status-interval 1
set-option -g status-left ''
set-option -g status-right '%l:%M%p'
set-option -g status-fg default
# Status Bar solarized-dark (default)
set-option -g status-bg black
# Set window notifications
setw -g monitor-activity on
set -g visual-activity on
# Allow the arrow key to be used immediately after changing windows
set-option -g repeat-time 0
# Set up easy go-to sessions with shortcuts
bind s source-file ~/.tmux.session1
# When in copy mode, v starts a selection and y finishes it
#bind-key -T copy-mode-vi 'v' send -X begin-selection
#bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel
bind-key -T copy-mode-vi 'y' send -X copy-pipe