-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
108 lines (86 loc) · 4.56 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
# bind -n C-k send-keys -R \; send-keys C-l \; clear-history
set -g @continuum-boot 'on'
# Make it easier to split panes
bind | split-window -h -c '#{pane_current_path}'
bind - split-window -v -c '#{pane_current_path}'
unbind '"'
unbind %
unbind C-z
# stop window renaming
set-option -g allow-rename off
bind-key -n S-Left select-window -t:-1
bind-key -n S-Right select-window -t:+1
bind-key -n S-Up select-pane -t:-1
setw -g mode-keys vi
set -g mouse on
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
setw -g aggressive-resize on
setw -g automatic-rename-format "#{b:pane_current_path}"
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
bind -n WheelDownPane select-pane -t= \; send-keys -M
bind -n C-WheelUpPane select-pane -t= \; copy-mode -e \; send-keys -M
bind-key / copy-mode
bind-key -T vi-copy '/' search-backward
# Clear the pane and it's history
bind k send-keys -R \; clear-history
set-option -g history-limit 50000
# smart pane switching with awareness of vim splits
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R"
# bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys 'C-\\') || tmux select-pane -l"
# C-l is taken over by vim style pane navigation
bind C-l send-keys 'C-l'
# To copy, drag to highlight text in yellow, press Enter and then release mouse
# Use vim keybindings in copy mode
# Update default binding of `Enter` to also use copy-pipe
bind r source-file ~/.tmux.conf \; display-message "Config reloaded."
set-option -g default-shell "/opt/homebrew/bin/nu"
set-option -g default-command "nu"
set -g synchronize-panes off
unbind -T copy-mode-vi MouseDragEnd1Pane
bind-key -T copy-mode-vi v send -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-pipe "pbcopy" \; display-message "copied to system clipboard"
bind P paste-buffer
bind-key -T copy-mode-vi Enter send-keys -X clear-selection
bind E command-prompt -p "Command:" \
"run \"tmux list-panes -a -F '##{session_name}:##{window_index}.##{pane_index}' \
| xargs -I PANE tmux send-keys -t PANE '%1' Enter\""
# bind . split-window -v "tmux list-sessions | sed -E 's/:.*$//' | grep -v \"^$(tmux display-message -p '#S')\$\" | fzf --reverse | xargs tmux switch-client -t"
bind . new-window "k9s"
bind e new-window "cd '~/src/flovilmart/dotfiles'; nvim '.tmux.conf'"
bind o split-window -h "^find ./src -maxdepth 2 -type d | fzf --reverse | xargs tmux new-window -c"
set -g status-left '#[fg=colour7,bg=colour234] #{pane_title} #[fg=colour234,bg=colour236] '
# set -g status-left '#[fg=colour7,bg=colour234] ⬡ #(~/.volta/bin/node --version)#[fg=colour7,bg=colour234] #[fg=colour234,bg=colour236] '
# set -g status-left '#[fg=colour7,bg=colour234] #[fg=colour7,bg=colour234] #{pane_current_path} #[fg=colour234,bg=colour236] '
set -g status-bg colour236
set -g status-fg colour245
set -g status-right-length 50
set -g status-left-length 50
setw -g window-status-style none
setw -g window-status-format '#I:#W'
setw -g window-status-current-style none
setw -g window-status-current-format ' #I:#W '
setw -g window-status-current-style 'bg=green,fg=colour236,bold'
set -g status-right '#[fg=colour234,bg=colour236]#[fg=colour7,bg=colour234,bold] %d/%m %H:%M:%S '
## message text
set-option -g message-style 'bg=colour236, fg=brightred'
set-option -g status-interval 1
set-option -g automatic-rename on
set-option -g automatic-rename-format '#{b:pane_current_path}'
## clock
set-window-option -g clock-mode-colour green #green
## bell
set-window-option -g window-status-bell-style fg=black,bg=red #base02, red
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-open'
# set -g @plugin 'tmux-plugins/tmux-continuum'
# set -g @continuum-restore 'on'
# set -g @resurrect-dir '~/.tmux/resurrect'
# set -g @resurrect-capture-pane-contents 'on'
# set -g @resurrect-save-shell-history 'on'
run -b '~/.tmux/plugins/tpm/tpm'
setw -g pane-border-format "#{pane_index} --- #{pane_current_path}"