-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtmux.conf
90 lines (72 loc) · 2.62 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
# C-b is weird, let's use screen's C-a
set-option -g prefix C-a
bind C-a send-prefix
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
setw -g pane-base-index 1
set-window-option -g automatic-rename on
set-option -g set-titles on
set-option -g mode-keys emacs
set -g default-terminal "screen-256color"
set -g history-limit 100000
setw -g xterm-keys on
setw -g mouse-utf8 on
setw -g mouse on
bind | split-window -h
bind - split-window -v
# select panes similir to vim
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind-key J resize-pane -D 5
bind-key K resize-pane -U 5
bind-key H resize-pane -L 5
bind-key L resize-pane -R 5
bind-key M-j resize-pane -D
bind-key M-k resize-pane -U
bind-key M-h resize-pane -L
bind-key M-l resize-pane -R
bind-key -n C-S-Left swap-window -t -1
bind-key -n C-S-Right swap-window -t +1
# Use Alt-arrow keys without prefix key to switch panes
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# Shift arrow to switch windows
bind -n S-Left previous-window
bind -n S-Right next-window
# No delay for escape key press
set -sg escape-time 0
# Reload tmux config
bind r source-file ~/.tmux.conf
# THEME
set -g status-bg black
set -g status-fg white
set -g window-status-current-bg white
set -g window-status-current-fg black
set -g window-status-current-attr bold
set -g status-interval 60
set -g status-justify centre
set -g status-left-length 40
set -g status-left '#[fg=blue]#(whoami)#[fg=red]@#[fg=green]#(hostname)[#[fg=yellow]#(curl icanhazip.com)#[fg=green]]#[default]'
set -g status-right "#[fg=blue]#S #I:#P #[fg=yellow]#[fg=red]::#[fg=yellow] %d %b %Y #[fg=red]::#[fg=green] #(date -u | awk '{print $4}' )#[fg=red]:: "
set -g mouse on
# set -g mouse-select-pane on
# set -g mouse-resize-pane on
# set -g mouse-select-window 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
bind -n C-WheelUpPane select-pane -t= \; copy-mode -e \; send-keys -M
bind -t vi-copy C-WheelUpPane halfpage-up
bind -t vi-copy C-WheelDownPane halfpage-down
bind -t emacs-copy C-WheelUpPane halfpage-up
bind -t emacs-copy C-WheelDownPane halfpage-down
# To copy, drag to highlight text in yellow, press Enter and then release mouse
# Use vim keybindings in copy mode
setw -g mode-keys vi
# Update default binding of `Enter` to also use copy-pipe
unbind -t vi-copy Enter
bind-key -t vi-copy Enter copy-pipe "xclip -selection clipboard"