-
Notifications
You must be signed in to change notification settings - Fork 1
/
.tmux.conf
127 lines (111 loc) · 4.34 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
set -g default-terminal "xterm-256color"
set -g prefix C-a
set -g history-limit 10000
# Sierra bug with clipboard
set -g default-shell $SHELL
set-option -g default-command "reattach-to-user-namespace -l zsh"
# enable activity alerts
setw -g monitor-activity off
set -g visual-activity off
# Center the window list
set -g status-justify centre
# automatically renumber tmux windows
set -g renumber-windows on
# Rather than constraining window size to the maximum size of any client
# connected to the *session*, constrain window size to the maximum size of any
# client connected to *that window*. Much more reasonable.
setw -g aggressive-resize on
# make delay shorter
set -sg escape-time 0
# make window/pane index start with 1
set -g base-index 1
setw -g pane-base-index 1
# set vi mode
setw -g mode-keys vi
set -g status-keys vi
# enable mouse support for switching panes/windows
setw -g mouse on
# enable clipboard
set -g set-clipboard on
######################
#### Plugins #########
######################
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-sidebar'
# set -g @continuum-restore 'on'
# restore pane contents
set -g @resurrect-capture-pane-contents 'on'
# restore bash history
set -g @resurrect-save-bash-history 'on'
# for vim
set -g @resurrect-strategy-vim 'session'
# for neovim
set -g @resurrect-strategy-nvim 'session'
######################
#### Key Bindings ####
######################
# reload config file
bind r source-file ~/.tmux.conf \; display "Config Reloaded!"
# switch window with alt-i and alt-o
bind -n M-i previous-window
bind -n M-o next-window
# quickly open a new window
bind N new-window
# split window and fix path for tmux 1.9
bind s split-window -h -c "#{pane_current_path}"
bind v split-window -v -c "#{pane_current_path}"
# list sessions with b instead of s, I'll use it for horizontal split like vim
bind b list-sessions
# x - kill window
bind x kill-window
# u - kill pane like vim
bind u kill-pane
# synchronize all panes in a window
bind y setw synchronize-panes
# pane movement shortcuts
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Resize pane shortcuts
bind -r H resize-pane -L 10
bind -r J resize-pane -D 10
bind -r K resize-pane -U 10
bind -r L resize-pane -R 10
##########################################################
#### THEME #### github.com/odedlaz/tmux-onedark-theme ####
##########################################################
onedark_black="#282c34"
onedark_blue="#61afef"
onedark_yellow="#e5c07b"
onedark_red="#e06c75"
onedark_white="#aab2bf"
onedark_green="#98c379"
onedark_visual_grey="#3e4452"
onedark_comment_grey="#5c6370"
set "status" "on"
set "status-justify" "centre"
set "status-left-length" "100"
set "status-right-length" "100"
setw "window-status-separator" ""
set "window-style" "fg=$onedark_comment_grey"
set "window-active-style" "fg=$onedark_white"
set "display-panes-active-colour" "$onedark_yellow"
set "display-panes-colour" "$onedark_blue"
set "status-bg" "$onedark_black"
set "status-fg" "$onedark_white"
set "@prefix_highlight_fg" "$onedark_black"
set "@prefix_highlight_bg" "$onedark_green"
set "@prefix_highlight_copy_mode_attr" "fg=$onedark_black,bg=$onedark_green"
set "@prefix_highlight_output_prefix" " "
set "status-left" "#[fg=$onedark_black,bg=$onedark_green,bold] #S #{prefix_highlight}#[fg=$onedark_green,bg=$onedark_black,nobold,nounderscore,noitalics]"
set "status-right" " #(while sleep 5; do ping -c 1 8.8.8.8 | tail -1| awk '{print $4}' | cut -d '/' -f 2; done)ms #[fg=green]#(rainbarf --nobattery --width 25 --rgb --no-bright)#[default] #(whoami)@#(hostname)"
set "window-status-format" "#[fg=$onedark_black,bg=$onedark_black,nobold,nounderscore,noitalics]#[fg=$onedark_white,bg=$onedark_black] #I #W #[fg=$onedark_black,bg=$onedark_black,nobold,nounderscore,noitalics]"
set "window-status-current-format" "#[fg=$onedark_black,bg=$onedark_visual_grey,nobold,nounderscore,noitalics]#[fg=$onedark_white,bg=$onedark_visual_grey,nobold] #I #W #[fg=$onedark_visual_grey,bg=$onedark_black,nobold,nounderscore,noitalics]"
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'