-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
98 lines (78 loc) · 2.76 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
# start counting from 1
set -g base-index 1
setw -g pane-base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
# Longer display times
set-option -g display-time 1500
# mode keys vi style
set-window-option -g mode-keys vi
bind -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "if [[ -z $WAYLAND_DISPLAY ]]; then xclip -in -selection clipboard; else wl-copy; fi"
set-option -g focus-events on
# fix vim lagging when switching modes.
set -sg escape-time 0
# remap prefix from C-b to C-s
unbind C-b
set-option -g prefix C-s
bind-key C-s send-prefix
# disables C-o for neovim - currently doesn't work
unbind-key -T prefix C-o
# better vertical and horizontal splits
bind - split-window -v -c '#{pane_current_path}'
bind \\ split-window -h -c '#{pane_current_path}'
bind c new-window -c '#{pane_current_path}'
unbind '"'
unbind %
# reload config file (change file location to your the tmux.conf you want to use)
bind r source-file ~/.tmux.conf
# toggle statusbar
bind b set -g status
# switching between windows
bind -n M-n refresh-client -S\; switch-client -p
bind -n M-m refresh-client -S\; switch-client -n
# Use Alt-vim keys without prefix key to switch panes
bind -n M-h select-pane -L
bind -n M-j select-pane -D
bind -n M-k select-pane -U
bind -n M-l select-pane -R
# resizing panes
bind H resize-pane -L 5
bind L resize-pane -R 5
bind K resize-pane -U 5
bind J resize-pane -D 5
# alt to switch windows
bind-key -n M-1 select-window -t 1
bind-key -n M-2 select-window -t 2
bind-key -n M-3 select-window -t 3
bind-key -n M-4 select-window -t 4
bind-key -n M-5 select-window -t 5
bind-key -n M-6 select-window -t 6
bind-key -n M-7 select-window -t 7
bind-key -n M-8 select-window -t 8
bind-key -n M-9 select-window -t 9
# mainly for nnn - quick way to kill all panes except current
bind -n M-o kill-pane -a
# custom shortcuts
bind-key o run-shell -b ~/.config/tmux/tmux-opendirs.sh
bind-key e run-shell -b ~/.config/tmux/tmux-kill-sessions.sh
# status bar configurations.
set -g status-position bottom
set -g status-style fg='#1e6ee8'
set -g message-style bg='#44475a',fg='#8be9fd'
set -g mode-style bg='#44475a',fg='#8be9fd'
set -g status-justify left
set -g status-left-style default
set -g status-right-style default
set -g status-left ""
set -g status-right '#($HOME/.config/tmux/tmux-sessions.sh)'
set -g status-left-length 80
set -g status-right-length 80
# Enable mouse mode (tmux 2.1 and above)
set -g mouse on
# true color and stylized underlines
set -g default-terminal "tmux-256color"
set -as terminal-overrides ",xterm*:Tc"
set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm'
set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m'