-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
99 lines (74 loc) · 3.15 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
# set prefix key to ctrl+t
unbind C-b
set -g prefix C-s
#Bind navigation pane like VIM
is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$"'
bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
# General
set -g base-index 1
set -g pane-base-index 1
set -g renumber-windows on
bind - split-window -v -c '#{pane_current_path}'
bind | split-window -h -c '#{pane_current_path}'
# Resize Pane
bind -n C-Left resize-pane -L 10
bind -n C-Right resize-pane -R 10
bind -n C-Down resize-pane -D 5
bind -n C-Up resize-pane -U 5
bind c new-window -c '#{pane_current_path}'
bind b break-pane -d
bind C-j split-window -v "tmux list-sessions | sed -E 's/:.*$//' | grep -v \"^$(tmux display-message -p '#S')\$\" | fzf --reverse | xargs tmux switch-client -t"
# Prompted join-pane
bind-key j command-prompt -p "join pane from: " "join-pane -h -s '%%'"
# Easily swap a pane (targeted by pane number) with the current pane
bind-key s display-panes\; command-prompt -p "pane #: " "swap-pane -t '%%'"
bind h split-window -h "htop"
bind t split-window -h -c $HOME/dotfiles "vi init.lua"
#Breaking Out Sessions
bind C-b send-keys 'tat && exit' 'C-m'
#Killing Session
bind K run-shell 'tmux switch-client -n \; kill-session -t "$(tmux display-message -p "#S")" || tmux kill-session'
# Reload config tmux file
bind r source-file ~/.tmux.conf \; display-message "tmux.conf reloaded!"
# Enable Mouse Mode
set -g mouse on
# Status bar
set -g status-left-length 20
# Use vim keybindings in copy mode
setw -g mode-keys vi
set-option -s set-clipboard off
bind P paste-buffer
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X rectangle-toggle
unbind -T copy-mode-vi Enter
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel 'xclip -se c -i'
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel 'xclip -se c -i'
# don't rename windows automatically
set-option -g allow-rename off
set-option -g status-position top
set -g status-right '#{prefix_highlight}'
# 24 bit color
# set -g terminal-overrides ',xterm-256color:Tc'
# set-option -ga terminal-overrides ",rxvt-unicode-256color:Tc"
set -g default-terminal "screen-256color"
set -ga terminal-overrides ",xterm-256color*:Tc"
# lsp-colors config
set -g default-terminal "${TERM}"
set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' # undercurl support
set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' # underscore colours - needs tmux-3.0
# Tmux Sensible
set -g focus-events on
setw -g aggressive-resize on
# 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 'tmux-plugins/tmux-continuum'
set -g @plugin 'arcticicestudio/nord-tmux'
set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
run-shell "~/.tmux/plugins/nord-tmux/nord.tmux"
run -b '~/.tmux/plugins/tpm/tpm'