-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.tmux.conf
executable file
·181 lines (145 loc) · 6.03 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# ╭─────────────────────────────────────────────╮
# │ Written by @Fadynagh from http://fadyio.com │
# │ Email:me@fadyio.com │
# │ Github: @fadyio │
# ╰─────────────────────────────────────────────╯
################################ Better prefix
unbind C-b
set -g prefix C-Space
# fix alacritty color
set-option -g default-terminal "xterm-256color"
set -g terminal-overrides 'xterm*:Tc'
set-option -sa terminal-overrides ",alacritty:RGB"
# Move window
bind -r < swap-window -t -1
bind -r > swap-window -t +1
# Resize panes like vim
bind -r j resize-pane -D 12
bind -r k resize-pane -U 12
bind -r l resize-pane -R 24
bind -r h resize-pane -L 24
# Switch between previous and next windows with repeatable
bind -r n next-window
bind -r p previous-window
# Move the current window to the next window or previous window position
bind -r N run-shell "tmux swap-window -t $(expr $(tmux list-windows | grep \"(active)\" | cut -d \":\" -f 1) + 1)"
bind -r P run-shell "tmux swap-window -t $(expr $(tmux list-windows | grep \"(active)\" | cut -d \":\" -f 1) - 1)"
# Switch between two most recently used windows
bind Space last-window
# source the config file with prefix and r
unbind r
bind r source-file ~/.tmux.conf
#plit panes using | and -
unbind v
unbind h
unbind '"'
bind | split-window -h
bind - split-window -v
# Enable mouse mode (tmux 2.1 and above)
bind -n WheelUpPane select-pane -t= \; copy-mode -e \; send-keys -M
bind -n WheelDownPane select-pane -t= \; send-keys -M
############################# tmux settings
# Ring the bell if any background window rang a bell
set -g bell-action any
# Notifying if other windows has activities
setw -g monitor-activity on
# Increase scrollback buffer size
set -g history-limit 10000
# Enable mouse mode (tmux 2.1 and above)
set -g mouse on
# renumber all windows when any window is closed
set -g renumber-windows on
# use system clipboard
set -g set-clipboard on
# update the status bar every 3 seconds
set -g status-interval 3
# Useful when using sharing a session with different size terminals
setw -g aggressive-resize on
# Start window and pane indices at 1.
set -g base-index 1
set -g pane-base-index 0
# new window
bind c new-window -c '#{pane_current_path}'
# Instant vim-mode change
set -s escape-time 0
set-window-option -g mode-keys vi
bind-key -T copy-mode-vi v send-keys -X begin-selection
setw -g mode-keys vi
is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L'
bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D'
bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U'
bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R'
bind-key -T copy-mode-vi 'C-h' select-pane -L
bind-key -T copy-mode-vi 'C-j' select-pane -D
bind-key -T copy-mode-vi 'C-k' select-pane -U
bind-key -T copy-mode-vi 'C-l' select-pane -R
#################################### List of plugins
# Tmux Plugin Manager
set -g @plugin 'tmux-plugins/tpm'
# A set of tmux options that should be acceptable to everyone.
set -g @plugin 'tmux-plugins/tmux-sensible'
# tmux theme and UI
set -g @plugin 'dracula/tmux'
set -g @dracula-plugins "git cpu-usage ram-usage time"
set -g @dracula-show-powerline true
# it can accept `session`, `smiley`, `window`, or any character.
set -g @dracula-show-left-icon "1"
set -g @dracula-show-empty-plugins false
# default is 1, it can accept any number and 0 disables padding.
set -g @dracula-left-icon-padding 1
# for left
set -g @dracula-show-left-sep " "
# for right symbol (can set any symbol you like as seperator)
set -g @dracula-show-right-sep ""
# CPU
set -g @dracula-cpu-usage-label " "
set -g @dracula-cpu-usage-colors "orange dark_gray"
# ssh
set -g @dracula-show-ssh-session-port true
# RAM
set -g @dracula-ram-usage-label " "
set -g @dracula-ram-usage-colors "pink dark_gray"
# Time
set -g @dracula-show-timezone false
set -g @dracula-time-colors "yellow dark_gray"
# Git
set -g @dracula-git-show-remote-status false
# default is unicode !. Avoid bash special characters
set -g @dracula-git-show-diff-symbol " "
set -g @dracula-git-show-current-symbol " "
set -g @dracula-git-colors "light_purple dark_gray"
# extrakto for tmux - quickly select, copy/insert/complete text without a mouse
set -g @plugin 'laktak/extrakto'
set -g @extrakto_popup_size '50%'
# Nerd Font icons for your tmux windows
set -g @plugin 'joshmedeski/tmux-nerd-font-window-name'
# Yank to system clipboard
set -g @plugin 'tmux-plugins/tmux-yank'
# The missing floating pane for Tmux
set -g @plugin 'omerxx/tmux-floax'
# set the keybinding for floax
set -g @floax-bind '.'
# When the pane is toggled, using this bind pops a menu with additional options
# such as resize, fullscreen, resetting to defaults and more.
set -g @floax-bind-menu 'r'
# The default width and height of the floating pane
set -g @floax-width '70%'
set -g @floax-height '50%'
# The border color can be changed, these are the colors supported by Tmux:
# black, red, green, yellow, blue, magenta, cyan, white
set -g @floax-border-color 'blue'
# The text color can also be changed, by default it's blue
set -g @floax-text-color 'cyan'
# tmux integration for nvim features pane movement and resizing from within nvim.
set -g @plugin 'aserowy/tmux.nvim'
# navigation
set -g @tmux-nvim-navigation true
set -g @tmux-nvim-navigation-cycle true
set -g @tmux-nvim-navigation-keybinding-left 'C-h'
set -g @tmux-nvim-navigation-keybinding-down 'C-j'
set -g @tmux-nvim-navigation-keybinding-up 'C-k'
set -g @tmux-nvim-navigation-keybinding-right 'C-l'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
# run -b '~/.tmux/plugins/tpm/tpm'