-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
129 lines (103 loc) · 3.54 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# Set 256 color mode
set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",*256col*:Tc"
set -as terminal-overrides ',st*:Ss@'
set -g terminal-overrides ",alacritty:RGB"
set -g terminal-overrides ",alacritty:Tc"
# Enable vim key bindings
set-window-option -g mode-keys vi
set -g status-keys vi
# Show status
set-option -g status on
# Set zsh as default shell
set-option -g default-shell /bin/zsh
set-option -g default-command /bin/zsh
# set prefix to control-t
#set -g prefix C-t
#set -g prefix C-x
# dont mess up with other ctrl-a options by pressing ctrl-a twice
bind C-a send-prefix
#unbind system defined prefix
#unbind C-b
# helps in faster key repetition
set -sg escape-time 0
# source .tmux.conf file
bind r source-file ~/.tmux.conf \; display "Configuration Reloaded!"
# vertical split
bind | split-window -h
# horizontal split
bind - split-window -v
# pane movement similar to vim
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# resize panes
bind -r C-h resize-pane -L 2
bind -r C-l resize-pane -R 2
bind -r C-k resize-pane -U 2
bind -r C-j resize-pane -D 2
# to cycle through windows
bind -r H select-window -t :-
bind -r J select-window -t :+
bind -r K select-window -t :-
bind -r L select-window -t :+
#bind p previous-window
#bind n next-window
# enable mouse
setw -g mouse on
# monitor activities in other windows
setw -g monitor-activity on
set -g visual-activity on
# remap copy paste keys
#unbind [
bind [ copy-mode
bind -T copy-mode-vi 'v' send-keys -X begin-selection
bind -T copy-mode-vi 'y' send-keys -X copy-selection
unbind p
bind p paste-buffer
# copy to system clipboard
bind C-y run "tmux save-buffer - | xclip -i -sel clipboard"
# paste from system clipboard
bind C-p run "tmux set-buffer \"$(xclip -o -sel clipboard)\"; tmux paste-buffer"
# maximizing and restoring panes
unbind Up
bind Up new-window -d -n tmp \; swap-pane -s tmp.1 \; select-window -t tmp
unbind Down
bind Down last-window \; swap-pane -s tmp.1 \; kill-window -t tmp
# switch between sessions
bind -r ( switch-client -p
bind -r ) switch-client -n
# recording program output to a log
bind P pipe-pane -o "cat >>~/#W.log" \; display "Toggled logging to ~/#W.log"
# don't allow tmux to rename the window based on commands running
#set-window-option -g allow-rename off
set -g lock-after-time 300
set -g lock-command "cmatrix -s"
## Theme
set -g status-position bottom
set -g window-status-separator ""
set -g pane-base-index 1
set -g base-index 1
set -g set-titles on
#set -g default-terminal "screen-256color"
set-option -g set-titles-string '#{pane_current_command}'
set-option -g history-limit 1000
# Borders
set -g pane-active-border-style "fg=white bg=default"
set -g pane-border-style "fg=darkgray bg=default"
# Status
set -g status-justify centre
set -g status-bg black
set -g status-left '#[fg=red,bg=white] ⸸ #[fg=white,bg=darkgray] #[fg=black,bg=darkgray]#{user}@#h : #S #[fg=darkgray,bg=black] '
set -g status-right '#[fg=black,bg=darkgray] #[fg=black,bg=darkgray]%Y-%m-%d %R #[fg=darkgray,bg=white]#[fg=red,bg=white] ⸸ '
set -g status-right-length 100
set -g status-left-length 100
setw -g window-status-current-format '#[fg=black,bg=white]#[fg=black,bg=white] #I#[fg=red,bg=white] ⛧ #[fg=black,bg=white]#W #[fg=white,bg=black] '
setw -g window-status-format '#[fg=gray,bg=black] #I ⛧ #W '
setw -g window-status-activity-style "blink fg=black bg=blue"
setw -g message-style bg=red,fg=white
setw -g message-command-style bg=red,fg=black
# Clock mode
set -g clock-mode-colour default
set -g clock-mode-style 24