-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
104 lines (85 loc) · 5.42 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
#
# Author: Ash <[email protected]>
#
# 256-color support in tmux based terminals (Useful for vim colorschemes)
set -g default-terminal "screen-256color"
# Pass through the xterm keys to the terminal
setw -g xterm-keys on
# Use vi key bindings for mode and status keys
setw -g mode-keys vi
set -g status-keys vi
# Turn on automatic rename for Window names
setw -g automatic-rename on
# Automatic window renumbering when a window is closed
set -g renumber-windows on
# Disable Monitor activity
setw -g monitor-activity off
# Display the pane numbers upto 10s
set -g display-panes-time 10000
# Increase the display messages timeout from 750ms to 5s
set -g display-time 5000
# Native xterm scrolling
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
# Mouse support
set -g mouse on # Enable mouse mode
# Lower wait time for the escape sequence
set -s escape-time 0
# Turn off aggressive resize
setw -g aggressive-resize off
# Set scrollback to 10000 lines
set -g history-limit 100000
# Turn on titles
set -g set-titles on
# Set the title
set -g set-titles-string '[#{pane_current_command}] #{pane_title}'
# Make pbcopy, pbpaste, and launchctl work in OS X
set-option -g default-command "reattach-to-user-namespace-wrapper -l $SHELL"
# Key bindings
set -g prefix C-a # Ctrl-a instead of Ctrl-b
unbind C-b; bind C-a send-prefix # Nested tmux, minicom, etc.
bind R source-file ~/.tmux.conf \; refresh-client -S # Re-source .tmux.conf
unbind l; unbind n; unbind o; unbind p; # No use for these
bind -n C-S-Left previous-window \; refresh-client -S # Previous window
bind -n C-S-Right next-window \; refresh-client -S # Next window
unbind Up; bind -n M-Up select-pane -U \; refresh-client -S # Up pane
unbind Down; bind -n M-Down select-pane -D \; refresh-client -S # Down pane
unbind Left; bind -n M-Left select-pane -L \; refresh-client -S # Left pane
unbind Right; bind -n M-Right select-pane -R \; refresh-client -S # Right pane
unbind C-Up; bind -r C-Up resize-pane -U # Move pane border Up
unbind C-Down; bind -r C-Down resize-pane -D # Move pane border Down
unbind C-Left; bind -r C-Left resize-pane -L # Move pane border Left
unbind C-Right; bind -r C-Right resize-pane -R # Move pane border right
bind j command-prompt -p "Join pane from: " "join-pane -s '%%'" # Join pane from window
bind s command-prompt -p "Send pane to: " "join-pane -t '%%'" # Send pane to window
bind W command-prompt -p "New window num: " "move-window -t '%%'" # Rename window number
unbind [; bind Escape copy-mode # Vi style enter copy mode
unbind ]; bind p paste-buffer # Vi style paste
unbind -T copy-mode-vi 'Space'; bind -T copy-mode-vi 'v' send-keys -X begin-selection # Vi style visual edit
bind -T copy-mode-vi 'y' send-keys -X copy-pipe-and-cancel "xsel -i" # Vi style yank (also primary)
bind -T copy-mode-vi 'Home' send-keys -X start-of-line # Beginning of line
bind -T copy-mode-vi 'End' send-keys -X end-of-line # End of line
bind -n M-S-Left swap-window -t -1 # Move Window Left
bind -n M-S-Right swap-window -t +1 # Move Window Right
# Fix Mouse Scrolling in 2.1 and higher versions
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M; send-keys -M; send-keys -M'; send-keys -M; send-keys -M; send-keys -M; send-keys -M; send-keys -M; send-keys -M"
bind -n WheelDownPane select-pane -t= \; send-keys -M \; send-keys -M \; send-keys -M
# Copy into clipboard
bind C-c choose-buffer "run \"tmux save-buffer -b '%%' - | xsel -i -b\""
# Paste from clipboard
bind C-v run "xsel -o -b | tmux load-buffer - && tmux paste-buffer"
# Copy into primary
bind C-y choose-buffer "run \"tmux save-buffer -b '%%' - | xsel -i\""
# Paste from primary
bind C-p run "xsel -o | tmux load-buffer - && tmux paste-buffer"
# Powerline config
set -g status on
set -g status-interval 30
set -g status-fg colour231
set -g status-bg colour234
set -g status-justify right
set -g status-left-length 140
set -g status-left '#[fg=colour231,bg=colour233,bold]#{?client_prefix,#[reverse]C-a#[noreverse],} #{session_name}:#{window_index}:#{pane_index} [#{window_flags}]#(tmux-powerline left)'
set -g status-right '#(tmux-powerline right)'
set -g status-right-length 50
set -g window-status-format "#[fg=colour244,bg=colour234]#{window_index} #[fg=colour240] #[fg=colour249]#{window_name} [#{window_panes}]#{window_flags} "
set -g window-status-current-format "#[fg=colour234,bg=colour23]#[fg=colour117,bg=colour23] #{window_index} #[fg=colour231,bold]#{window_name} [#{window_panes}] #[fg=colour23,bg=colour234,nobold]"