-
Notifications
You must be signed in to change notification settings - Fork 1
/
.tmux.conf
88 lines (65 loc) · 2.32 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
# Dependencies:
# - powerline
# - urlview
# - xclip
# C-z prefix
unbind-key C-b
set-option -g prefix C-z
bind-key z send-keys C-z
# Copy and paste
set-environment -g DISPLAY :0.0
bind y run "tmux show-buffer | xclip -i -selection primary"
bind P run "tmux set-buffer -- \"$(xclip -o -selection primary)\"; tmux paste-buffer"
# C-z C-z and C-z z toggle windows
bind-key C-z last-window
set-option -g set-clipboard on
# Start window index of 1 instead of 0
set-option -g base-index 1
# Start panes at 1 instead of 0
set-window-option -g pane-base-index 1
# Set copy mode to escape key
bind Escape copy-mode
# Instant copy mode
set -s escape-time 0
# More straight forward key bindings for splitting
unbind %
bind | split-window -h
unbind '"'
bind - split-window -v
# Vim-like keybinds
set -g status-keys vi
setw -g mode-keys vi
# Use v to trigger selection
bind-key -T copy-mode-vi v send-keys -X begin-selection
# Use y to yank current selection
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
# Moving between panes
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Open a man page in new pane or window
# bind m command-prompt -p 'man' 'split-window -h "exec man %%"'
# bind M command-prompt -p 'man' 'new-window -n "man %1" "exec man %1"'
# Make mouse useful in copy mode
# set mouse on
# Make active window name bold
# setw -g window-status-current-attr bold
# Set $TERM to screen-256color
set -g default-terminal 'screen-256color'
# Status line
# source "$HOME/Library/Python/2.7/lib/python/site-packages/powerline/bindings/tmux/powerline.conf"
# Big history buffer
set -g history-limit 10000
# Disable window title renaming.
set-option -g allow-rename off
unbind x
bind-key q confirm-before kill-pane
bind-key Q confirm-before kill-session
# Reload configuration file
bind r source-file "$HOME/.tmux.conf" \; display-message 'Reloaded .tmux.conf'
# Jump to session by name.
bind f command-prompt -p session: "run-shell 'tmux-switch-session \"%%\"'"
# Open URL with a web browser
if-shell 'test "$(uname -s)" = "Darwin"' 'bind o run "tmux show-buffer && open \"$(tmux show-buffer)\"" \; display-message "Opened buffer contents"'
if-shell 'test "$(uname -s)" = "Linux"' 'bind o run "tmux show-buffer && xdg-open \"$(tmux show-buffer)\"" \; display-message "Opened buffer contents"'