focus.nvim icon indicating copy to clipboard operation
focus.nvim copied to clipboard

Scroll other window

Open zaatas opened this issue 3 years ago • 6 comments

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.

zaatas avatar May 25 '22 23:05 zaatas

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?

beauwilliams avatar Jul 24 '22 08:07 beauwilliams

function! ScrollOtherWindow(direction) execute 'wincmd' (winnr('#') == 0 ? 'w' : 'p') execute (a:direction ? "normal! <C-y>" : "normal! <C-e>") wincmd p endfunction

zaatas avatar Jul 27 '22 05:07 zaatas

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)

zaatas avatar Jul 27 '22 05:07 zaatas

Thoughts

zaatas avatar Aug 07 '22 06:08 zaatas

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

beauwilliams avatar Aug 10 '22 23:08 beauwilliams

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]

zaatas avatar Aug 19 '22 02:08 zaatas