Scroll other window
Thought: The ability to Scroll and Page Up/Down the "other" window in a split. Other defined as all window/s that do not have the present focus. I'm using a vim script hack I cobbled together a few years ago. Yet, such a feature in this plugin could be most advantageous.
Ahhh, so in short, being able to scroll the unfocused windows without switching to them. Neat! I can see this would be useful.
How are you managing this with mappings, how do you prefer to set them up?
function! ScrollOtherWindow(direction) execute 'wincmd' (winnr('#') == 0 ? 'w' : 'p') execute (a:direction ? "normal! <C-y>" : "normal! <C-e>") wincmd p endfunction
I'm using mrjones2014/legendary.nvim for mappings + map documentation
local options = { noremap = true, silent = true }
local lhk_keymaps = {
{ "<S-A-j>", ":call ScrollOtherWindow(1)<CR>", description = "Scroll Other Win Up", opt = options },
{ "<S-A-k>", ":call ScrollOtherWindow(0)<CR>", description = "Scroll Other Win Down", opt = options },
}
require('legendary').bind_keymaps(lhk_keymaps)
Thoughts
Nice! Yeah this looks good, I think we can have it either automatically use next window, or a way to choose a window. Probably easiest to keep a list also for reference
Thoughts: Default: From the active window, limit scrolling to the adjacent (L/R) window. Option: From the active window, (using telescope), select & change the buffer displayed in the adjacent (L/R) window.
Like you, I have limited time and am new to nvim's lua api's. Yet, I'd really like to help add/test, etc. these to your plugin.
I can be reached at: [email protected]