-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
117 lines (90 loc) · 3.03 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
# USEFUL THINGS TO REMEMBER
# remain-on-exit command
# Tmux specific project setup in bash config
set -g default-shell $SHELL
set-option -g default-command "reattach-to-user-namespace -l bash"
set-option -g default-command "bash --init-file ~/.bash_profile"
set-option -g remain-on-exit on
# Respawning
bind-key S respawn-pane
# Switch windows
bind-key b last-window
# This sets default key to control-a instead of control-b.
# I also recommend remapping caps lock to control in system preferences
set-option -g prefix C-a
bind-key C-w last-window
set-option -g default-terminal "screen-256color"
# act like vim
setw -g mode-keys vi
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Navigate panes
bind e display-panes
bind K kill-pane -a -t 0
# search mode
unbind [
bind a copy-mode
# new window
unbind n
bind n new-window
# Setup 'v' to begin selection as in Vim
unbind v
bind-key -T copy-mode-vi v send-keys -X begin-selection
# Copy to system buffer
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
# Move x clipboard into tmux paste buffer and paste
bind p run "tmux set-buffer \"$(reattach-to-user-namespace pbpaste)\"; tmux paste-buffer"
set -g history-limit 8192
# setw -g automatic-rename off
set-option -g set-titles on
set-option -g set-titles-string '#(hostname -s):#I.#P #W #T' # window number,program name,active (or not)
set-window-option -g window-status-fg black
set-window-option -g window-status-current-fg colour232
set-window-option -g window-status-current-attr bold
set -g status-left-length 20
set-option -g lock-after-time 300
# Some thing wrong in sierra
# set-option -g lock-server on
set -g lock-command vlock
unbind Left
unbind Right
unbind Down
unbind Up
bind -r Left resize-pane -L 5
bind -r Right resize-pane -R 5
bind -r Down resize-pane -D 5
bind -r Up resize-pane -U 5
unbind %
bind | split-window -h -c "#{pane_current_path}"
bind _ split-window -v -c "#{pane_current_path}"
# Reload tmux config
bind-key "R" run-shell "tmux source-file ~/.tmux.conf"
# Clear history
bind -n C-k clear-history
# Vim
unbind t
bind t copy-mode \; send-keys 'B' 'v' 'e' 'y' \; new-window "reattach-to-user-namespace -l vim -c 'call FunSearchTagFromClipboard()'"
# Web
unbind m
bind-key -T copy-mode-vi m send-keys copy-pipe-and-cancel "ws"
# Remove escape delay
set -s escape-time 0
# Show time
bind-key X run-shell "date"
bind-key C run-shell "cal"
# don't prompt
bind-key Q run-shell "kill-if-not-last-window"
bind-key q run-shell "kill-if-not-last-pane"
# breaker
bind-key B break-pane \; rename-window broken
bind-key J join-pane -h -p 50 -s broken
# Mail
bind-key M new-window -n "Mutt" "source ~/.bash_profile ; mutt"
# Vifm
bind-key V new-window -c "#{pane_current_path}" "source ~/.bash_profile ; reattach-to-user-namespace -l vifm ."
bind-key H run-shell "rm ~/.vifm/vifminfo*"
# Config
bind-key I new-window -n "configuration" "source ~/.bash_profile ; vim ~/.bash_profile" \; \
split-window -v -p 50 "source ~/.bash_profile ; vim ~/.tmux.conf"