Fork me on GitHub
#practicalli
<
2023-10-18
>
Lucio Assis20:10:57

Does ctrl+arrow for resizing panes work for anyone with the default AstroNvim setup? Doesn't seem to work for me.

practicalli-johnny20:10:34

ctrl+ and ctrl+ resize neotree window or other horizontal splits, but not vertical splits.

practicalli-johnny20:10:49

https://docs.astronvim.com/basic-usage/walkthrough/#resizing-buffers says ctrl + arrows should work. It seems that ctrl-<down-arrow> and ctrl+<up-arrow> are entering visual select state rather than resizing the vertical split.

Lucio Assis20:10:13

It doesn't work horizontally for me either, so I guess something else is picking that up in my setup.

practicalli-johnny21:10:57

I removed the lua/user link to my user configuration with my additional plugins and that restored the resize split movement in all directions. So it does seem to be one of the plugins or key mappings I've added

practicalli-johnny21:10:44

I believe its the https://github.com/mg979/vim-visual-multi plugin I've been using that is blocking the vertical split resize, as it provides key bindings that over-ride the astronvim config. Luckily it was the first plugin that I commented out from my astronvim user config (I have 23 possible, but it seemed a good starting point). I use SPC p S to sink packages and then opened AstroNvim in a different terminal to test. I'm stlll reading/interpreting the neovim docs to understand how to list what command a key mapping is doing... I beleive map listing is the appropriate docs... https://neovim.io/doc/user/map.html#map-listing

practicalli-johnny22:10:14

:verbose map <C-Up> will show the last place in the config that defines a mapping for Ctrl+ Up arrow. I look at the details using SPC f n to list all notifications and Enter to see the relevant notification details.

awesome 1
practicalli-johnny11:10:18

I found remapping the key bindings to resize window splits easier to work with, than trying to remove the visual-vm-multi key bindings In my astronvim-user config mappings.lua file I've added the following to use shift+arrow keys to resize window splits, although those key bindings may also conflict with a plugin or astronvim keys...

return {
  -- first key is the mode
  n = {
    -- Rebind window resize key map to avoid clash with visual-vm plugin
    [""] = { function() require("smart-splits").resize_up() end, desc = "Resize split up" },
    [""] = { function() require("smart-splits").resize_down() end, desc = "Resize split down" },
    [""] = { function() require("smart-splits").resize_left() end, desc = "Resize split left" },
    [""] = { function() require("smart-splits").resize_right() end, desc = "Resize split right" },
  },
}
It seems a function is required to ensure smart-splits is loaded (there may be a better approach)