chrisbra/NrrwRgn

Split within current vsplit

Opened this issue · 2 comments

This could be an awful black morass but... I usually edit with 2-3 vsplits open:

|a|b|c

The narrowed region opens above all these:

narrow
|a|b|c

which isn't very 'narrow'! I'd prefer:

|a|  b   |c
| |narrow|c

IE for my current vsplit to be hsplit. Hope that's clear!

I tried :belowright and :botright but neither seemed to do anything.

Yeah, custom commands did not respect the command modifiers like :belowright until recently. I'll see if I can implement this easily (at least for newer vims).
However in the meantime, have a look here:

If you don't like that your narrowed window opens above the current window,
define the g:nrrw_topbot_leftright variable to your taste, e.g. >
let g:nrrw_topbot_leftright = 'botright'
<
Now, all narrowed windows will appear below the original window. If not
specified, the narrowed window will appear above/left of the original window.
(default: topleft)

That'd be ace, thanks! I'm using Neovim btw.

The setting is helpful but it doesn't help with part of my usecase that I forgot to mention: it'd be really good if the cursor returned to the split it was in when you narrowed, or at least the one it was in previously. Currently if I narrow from 'b' then close the narrow, I end up in 'a'.