-
Notifications
You must be signed in to change notification settings - Fork 6
/
tmux.conf
92 lines (71 loc) · 2.28 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
#
# .tmux.conf
#
# See also:
#
# http://zanshin.net/2013/09/05/my-tmux-configuration
# http://files.floriancrouzat.net/dotfiles/.tmux.conf
# https://github.com/tmuxinator/tmuxinator
# https://github.com/remiprev/teamocil
# http://robots.thoughtbot.com/love-hate-tmuxhttp://robots.thoughtbot.com/love-hate-tmux
#
# use CTRL-\ instead of CTRL-B
set-option -g prefix 'C-\'
bind 'C-\' last-window
bind '\' last-window
# Clear scrollback buffer a la cmd-k in iTerm
bind C-k send-keys -R \; clear-history
# Rename current tab a la vim's CtrlSpace
unbind =
bind = command-prompt "rename-window '%%'"
# Prev/Next Tab. NO. That's for copy/paste, sport.
bind 'C-[' previous-window
bind 'C-]' next-window
# Split window a la vim <C-W>s and <C-W>v
unbind '%'
unbind '"'
bind 's' split-window
bind 'v' split-window -h
# Create new tab (aka window) a la iTerm2/terminal
unbind 't'
bind 't' new-window
# Close a tab a la vim's "<C-w> c"
unbind 'c'
unbind 'x'
bind 'c' confirm-before -p "kill-pane #P? (y/n)" kill-pane
# improve colors (see also tmux alias)
set -g default-terminal "screen-256color"
# set window and pane index to 1 (0 by default)
set-option -g base-index 1
setw -g pane-base-index 1
# reload ~/.tmux.conf using PREFIX r
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# http://www.tylercipriani.com/2013/09/12/important-lines-in-my-tmux.htmlhttp://www.tylercipriani.com/2013/09/12/important-lines-in-my-tmux.html
set-option -sg escape-time 0
# Toggle expand current window, a la vim's <C-W>e
bind e resize-pane -Z \
# Vi copypaste mode
set-window-option -g mode-keys vi
bind -t vi-copy 'v' begin-selection
bind -t vi-copy 'y' copy-selection
# hjkl pane traversal
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Toggle between panes, a la vim's "<C-W> p"
unbind 'p'
bind 'p' last-pane
# Move tab to the left or right, a la CtrlSpace +/-
bind - swap-window -t -1
bind + swap-window -t +1
# http://thedrearlight.com/blog/tmux-vim.html
set -g mode-mouse on
setw -g mouse-select-window on
setw -g mouse-select-pane on
setw -g mouse-resize-pane on
# clock
set-window-option -g clock-mode-colour colour64 #green
# Tmux needs snippets...
bind 'a' send-keys -l 'caller.reject {|x| x["vendor/bundle"] || x["/.rbenv/versions/"] }.collect { |x| x.gsub(Dir.pwd, "''") }'