📦️ deps(tmux): smart splits is now a tmux plugin

This commit is contained in:
Sergio Laín 2025-03-25 14:23:19 +01:00
parent ee995e80a3
commit 09c80f0a53
No known key found for this signature in database
GPG key ID: 51BB28D8B42FB438
2 changed files with 7 additions and 24 deletions

View file

@ -53,29 +53,5 @@ bind-key M-q kill-session
bind -r "<" swap-window -d -t -1
bind -r ">" swap-window -d -t +1
# Smart pane switching with awareness of Neovim splits.
bind-key -n C-h if -F "#{@pane-is-vim}" 'send-keys C-h' 'select-pane -L'
bind-key -n C-j if -F "#{@pane-is-vim}" 'send-keys C-j' 'select-pane -D'
bind-key -n C-k if -F "#{@pane-is-vim}" 'send-keys C-k' 'select-pane -U'
bind-key -n C-l if -F "#{@pane-is-vim}" 'send-keys C-l' 'select-pane -R'
# Smart pane resizing with awareness of Neovim splits.
bind-key -n C-left if -F "#{@pane-is-vim}" 'send-keys C-left' 'resize-pane -L 5'
bind-key -n C-down if -F "#{@pane-is-vim}" 'send-keys C-down' 'resize-pane -D 5'
bind-key -n C-up if -F "#{@pane-is-vim}" 'send-keys C-up' 'resize-pane -U 5'
bind-key -n C-right if -F "#{@pane-is-vim}" 'send-keys C-right' 'resize-pane -R 5'
tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if -F \"#{@pane-is-vim}\" 'send-keys C-\\' 'select-pane -l'"
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if -F \"#{@pane-is-vim}\" 'send-keys C-\\\\' 'select-pane -l'"
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
bind-key -T copy-mode-vi 'C-\' select-pane -l
# Projects
bind-key Enter popup -E -h 80% -w 80% "dev"

View file

@ -5,6 +5,7 @@ set -g @plugin 'catppuccin/tmux#v0.3.0'
set -g @plugin 'omerxx/tmux-sessionx'
set -g @plugin 'wfxr/tmux-fzf-url'
set -g @plugin 'omerxx/tmux-floax'
set -g @plugin 'mrjones2014/smart-splits.nvim'
# Plugin Options
# Catppuccin
@ -52,3 +53,9 @@ set -g @fzf-url-bind 'u'
set -g @floax-bind '-n M-p'
set -g @floax-border-color 'white'
set -g @floax-text-color 'white'
# smart-splits
set -g @smart-splits_resize_left_key 'C-left'
set -g @smart-splits_resize_down_key 'C-down'
set -g @smart-splits_resize_up_key 'C-up'
set -g @smart-splits_resize_right_key 'C-right'