mrjones2014 / smart-splits.nvim

🧠 Smart, seamless, directional navigation and resizing of Neovim + terminal multiplexer splits. Supports tmux, Wezterm, and Kitty. Think about splits in terms of "up/down/left/right".
MIT License
977 stars 43 forks source link

listen to key repeats after leader #13

Closed bradyslot closed 2 years ago

bradyslot commented 2 years ago

In the way I use tmux, I press the prefix key then use the arrow keys for any direction and it will listen for repeated key presses for resizing panes. I believe there's a 500ms timeout by default. The resize behavior is identical to what this plugin hopes to achieve, so it's logically consistent with what I'm used to. I would just love the ability to press the leader key and have it listen for a resize command for 500ms and repeat. Currently I have this plugin mapped to ctrl+arrowkeys, which also works great, and am happy to settle for if this feature turns out to nonsensical.

example tmux.conf

# resizing with arrow keys because they're hardly used
unbind Left
bind -r Left resize-pane -L 5
unbind Right
bind -r Right resize-pane -R 5
unbind Down
bind -r Down resize-pane -D 5
unbind Up
bind -r Up resize-pane -U 5
mrjones2014 commented 2 years ago

I'm interested in experimenting with this but currently I have no idea how that would be implemented. I might get some time this weekend.

bradyslot commented 2 years ago

Perhaps the secrets lie within submodules? https://vi.stackexchange.com/questions/3632/how-to-repeat-a-mapping-when-keeping-key-pressed

mrjones2014 commented 2 years ago

Ooh, great resource. Will definitely do some tinkering with that this weekend.