-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux.conf
90 lines (72 loc) · 2.96 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
# My tmux config uses folds in vim.
#
# zR open all folds
# zM close all folds
# za toggle fold at cursor position
# zj move down to start of next fold
# zk move up to end of previous fold
# General tmux settings {{{1
# ------------------------------------------------------------------
# Set the delay so that it doesn't interfere with applications like
# vim
set -sg escape-time 0
# use vi key bindings
setw -g mode-keys vi
# turn on mouse mode
setw -g mouse on
# Don't mark the window on right click
unbind -T root MouseDown3Pane
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e'"
bind -n WheelDownPane select-pane -t= \; send-keys -M
# Default is to copy and cancel selection, this copys to the clipboard and leaves the selection
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe "pbcopy" \; display-message 'text copied to clipboard!'
# copy pasta
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe "pbcopy" \; display-message 'Text copied to clipboard!'
bind-key -T copy-mode-vi y send-keys -X copy-pipe "pbcopy" \; display-message 'Text copied to clipboard!'
# vi like copy mode
# from https://twitter.com/nickmorrott/status/928343075646210050?s=09
bind -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi V send-keys -X select-line
bind -T copy-mode-vi C-v send-keys -X rectangle-toggle \; send-keys -X begin-selection
bind -T copy-mode-vi Escape send-keys -X cancel
# set the scrollback
set -g history-limit 200000
# force tmux to use utf-8
setw -gq utf8 on
# Custom key bindings {{{1
# ------------------------------------------------------------------
# Reload the tmux config
bind r source-file ~/.tmux.conf \; display "tmux config reloaded!"
bind R source-file ~/.tmux/theme_claytron_slim.tmux \; display "no unicode chars in prompt"
# screen like logging of the current window
bind H pipe-pane -o 'cat >> $HOME/#W-`date +%s`-tmux.log'
# Make it obvious that this is a special window
bind P source-file ~/.tmux/warning.tmux
# Then back to normal
bind O source-file ~/.tmux/tmuxline_window.tmux
# Create a new session
bind S new-session
# Easier window controls {{{2
# ------------------------------------------------------------------
# Window splits (also see 1-9.tmux for new style default path)
unbind '"'
unbind %
bind \\ split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
# Vim style pane movement
bind C-h select-pane -L
bind C-j select-pane -D
bind C-k select-pane -U
bind C-l select-pane -R
# Move windows while holding control
bind C-p previous-window
bind C-n next-window
# Pane re-sizing
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
unbind L
bind -r L resize-pane -R 5
# Copy mode holding ctrl
bind C-[ copy-mode