-
Notifications
You must be signed in to change notification settings - Fork 3
/
.tmux.conf
88 lines (80 loc) · 3.19 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
# tmux config
#if-shell "uname | grep -q Darwin" "tmux-cmd1; tmux-cmd2;" "tmux-cmd3; tmux-cmd4"
if-shell "uname | grep -q Darwin" \
"source /opt/homebrew/lib/python3.9/site-packages/powerline/bindings/tmux/powerline.conf" \
"source /usr/local/lib/python3.8/dist-packages/powerline/bindings/tmux/powerline.conf"
#if-shell "uname -a | grep -q Ubuntu" \
# "source $HOME/.local/lib/python2.7/site-packages/powerline/bindings/tmux/powerline.conf"
# "source /usr/local/lib/python2.7/dist-packages/powerline/bindings/tmux/powerline.conf"
#if-shell "lsb_release -a | grep -q CentOS" \
# "source /usr/lib/python2.7/site-packages/powerline/bindings/tmux/powerline.conf"
if-shell "uname | grep -q Darwin" \
"set-option -g default-command \"reattach-to-user-namespace -l zsh\""
if-shell "uname | grep -q Darwin" \
"bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel \"reattach-to-user-namespace pbcopy\""
set-window-option -g xterm-keys on
set -g prefix2 C-a # GNU-Screen compatible prefix
bind C-a send-prefix
# last window
bind a last
set -g default-terminal "screen-256color"
# increase history limitation
set-option -g history-limit 100000
# clear history for tailing log
#bind -n C-u send-keys -R \; clear-history
# send delay in case of clash with vim
set -sg escape-time 1
# start windows numbering at 1
set -g base-index 1
# start pane numbering at 1
setw -g pane-base-index 1
# set terminal title
set -g set-titles on
#set -g set-titles-string '#h ❐ #S ● #I #W'
set -g set-titles-string '❐ #S ● #I #W'
# set prefix r to renew the configration
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# pane split
bind -r c new-window -c "#{pane_current_path}"
bind -r | split-window -h -c "#{pane_current_path}"
bind -r - split-window -v -c "#{pane_current_path}"
# pane resizing
bind -r H resize-pane -L 2
bind -r J resize-pane -D 2
bind -r K resize-pane -U 2
bind -r L resize-pane -R 2
# pane navigation
bind h select-pane -L # move left
bind j select-pane -D # move down
bind k select-pane -U # move up
bind l select-pane -R # move right
# window navigation
bind -r C-h select-window -t :-
bind -r C-l select-window -t :+
bind -r > swap-pane -D # swap current pane with the next one
bind -r < swap-pane -U # swap current pane with the previous one
# set vim mode
setw -g mode-keys vi
# set mouse
set -g mouse on
# if do not display powerline
# uncomment the following code
## status bar
## refresh
#set -g status-interval 1
## alignment
#set -g status-justify left
## width
#set -g status-left-length 20
#set -g status-right-length 100
## colors
#set -g status-bg '#333333'
#set -g status-fg '#ffffff'
#set -g status-left '#{?client_prefix, #[bg=green] [#S] #[default], #[bg=cyan] [#S] #[default]} '
#set -g status-right '#{?client_prefix, #[bg=green] ⌨ , } #[fg=white,bg=#222222] [#(uptime -p)] #[fg=white,bg=#444444] [#h] #[fg=white,bg=#666666] %Y-%m-%d #[fg=white,bg=#888888] %H:%M:%S '
#
#set -g window-status-format "#[fg=white,bg=colour234] #I#F #W "
#setw -g window-status-current-format '#[bg=#4e1c6b, fg=#ffffff, bold] [#I#F] #W '
#set -wg window-status-last-style 'fg=brown,bold'
#set -wg window-status-separator " "
#set-option -g allow-rename off