-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
92 lines (73 loc) · 3.02 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
# utf 8
set -g default-terminal "screen-256color"
# Enable all mouse options
set -g mouse on
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'"
bind -n WheelDownPane select-pane -t= \; send-keys -M
# remap prefix to Control + a
set -g prefix C-a
unbind C-b
bind C-a send-prefix
# quick pane cycling
unbind ^A
bind ^A select-pane -t :.+
# smart pane switching with awareness of vim splits
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R"
bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys 'C-\\') || tmux select-pane -l"
#Copy tmux paste buffer to CLIPBOARD
bind C-c run "tmux save-buffer - | xclip -i -selection clipboard"
#Copy CLIPBOARD to tmux paste buffer and paste tmux paste buffer
bind C-v run "tmux set-buffer -- \"$(xclip -o -selection clipboard)\"; tmux paste-buffer"
# Adjust terminal title when connected via SSH
set -g set-titles on
set -g set-titles-string "[$(pwd -P)] #T"
# vim friendliness
set -sg escape-time 1
set -g mode-keys vi
set -g history-limit 10000
# y and p as in vim
bind Escape copy-mode
unbind p
bind p paste-buffer
#bind-key -T copy-mode-vi 'v' begin-selection
#bind-key -T copy-mode-vi 'y' copy-selection
#bind-key -T copy-mode-vi 'Space' halfpage-down
#bind-key -T copy-mode-vi 'Bspace' halfpage-up
# easy-to-remember split pane commands
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
unbind '"'
unbind %
# clear the current pane
bind -n C-g send-keys -R \; clear-history \;
# status line
set -g status-position bottom
set -g status-left "B: #(pmset -g batt|awk '{print $2}'|tail -1)"
set -g status-right '#(date +"%a %d %b") | #(date +"%H:%M") | #(osx-cpu-temp)'
set -g status-justify left
set -g window-status-format ' #I·#W'
set -g window-status-current-format ' #I·#W'
set -g window-status-current-fg colour24
#set -g window-status-current-bg colour16
# colors
#set -g pane-border-bg colour0
set -g pane-border-fg colour9
#set -g pane-active-border-bg colour14
set -g pane-active-border-fg colour16
set -g status-bg colour0
set -g status-fg colour243
# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf
# urxvt tab like window switching (-n: no prior escape seq)
bind -n S-down new-window
bind -n S-left prev
bind -n S-right next
bind -n C-left swap-window -t -1
bind -n C-right swap-window -t +1
set-window-option -g aggressive-resize on
set -g default-shell $SHELL
set -g default-command "reattach-to-user-namespace -l ${SHELL}"