-
Notifications
You must be signed in to change notification settings - Fork 15
/
.tmux.conf
89 lines (74 loc) · 3.68 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
# default prefix mappings start with ^b (ctrl+b) then bound key(s)
# lets make it less stressful on my poor hands:
# act like GNU screen
unbind C-b
set -g prefix C-a
set-option -g default-shell /bin/bash
# Binding to reload config file, useful for tweaking tmux
bind R source ~/.tmux.conf \; display-message "Conf reloaded..."
# color
set -g default-terminal "screen-256color"
# status bar
set-option -g status-utf8 on
# Mouse support - set to on if you want to use the mouse
setw -g mode-mouse on
set -g mouse-select-pane on
set -g mouse-resize-pane on
set -g mouse-select-window on
# act like vim
setw -g mode-keys vi
# split windows like vim
# vim's definition of a horizontal/vertical split is reversed from tmux's
bind s split-window -v
bind v split-window -h
# move around panes with hjkl, as one would in vim after pressing ctrl-w
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# resize panes like vim
# feel free to change the "1" to however many lines you want to resize by, only
# one at a time can be slow
bind < resize-pane -L 10
bind > resize-pane -R 10
bind - resize-pane -D 10
bind + resize-pane -U 10
# Status bar settings adapted from powerline
set -g status on
set -g status-utf8 on
set -g status-interval 10
set -g status-fg colour231
set -g status-bg colour234
set -g status-left-length 20
set -g status-left '#{?client_prefix,#[fg=colour254]#[bg=colour31]#[bold],#[fg=colour16]#[bg=colour254]#[bold]} #S #{?client_prefix,#[fg=colour31]#[bg=colour234]#[nobold],#[fg=colour254]#[bg=colour234]#[nobold]}'
set -g status-right '#(eval cut -c3- ~/.tmux.conf | sh -s status_right)'
set -g status-right-length 150
set -g window-status-format "#[fg=colour244,bg=colour234]#I #[fg=colour240] #[default]#W "
set -g window-status-current-format "#[fg=colour234,bg=colour31]#[fg=colour117,bg=colour31] #I #[fg=colour231,bold]#W #[fg=colour31,bg=colour234,nobold]"
#set -g window-status-last-style fg=colour31
set -g window-status-last-fg colour31
set-window-option -g window-status-fg colour249
set-window-option -g window-status-activity-attr none
set-window-option -g window-status-bell-attr none
set-window-option -g window-status-activity-fg yellow
set-window-option -g window-status-bell-fg red
set-window-option -g mode-keys vi
# copy and pasting
# <C-v> (ctrl+shift+v) to paste)
# source 3:
## <Prefix>-y to copy whatever is in your top tmux buffer to your system clipboard.
## requires: sudo apt-get install xclip
bind y run-shell "tmux show-buffer | xclip -sel clip -i" \; display-message "Copied tmux buffer to system clipboard"
#bind -t vi-copy y copy-pipe 'xclip -in -selection clipboard'
# Send the same command to all panes/windows/sessions
bind E command-prompt -p "Command:" \
"run \"tmux list-sessions -F '##{session_name}' | xargs -I SESS \
tmux list-windows -t SESS -F 'SESS:##{window_index}' | xargs -I SESS_WIN \
tmux list-panes -t SESS_WIN -F 'SESS_WIN.##{pane_index}' | xargs -I SESS_WIN_PANE \
tmux send-keys -t SESS_WIN_PANE '%1' Enter\""
# bind E command-prompt -p "Command:" \ "run \"tmux list-sessions -F '##{session_name}' | xargs -I SESS \ tmux list-windows -t SESS -F 'SESS:##{window_index}' | xargs -I SESS_WIN \ tmux list-panes -t SESS_WIN -F 'SESS_WIN.##{pane_index}' | xargs -I SESS_WIN_PANE \ tmux send-keys -t SESS_WIN_PANE '%1' Enter\""
# sources
## https://gist.github.com/rssvihla/789284
## https://github.com/alerque/que-tmux/blob/master/.tmux.conf
## http://blog.joncairns.com/2013/06/copying-between-tmux-buffers-and-the-system-clipboard/
## http://unix.stackexchange.com/questions/131011/use-system-clipboard-in-vi-copy-mode-in-tmux