How to disable horizontal scrolling
I've written a solution that disables horizontal scrolling, (by riffing off of @ЯрославРахматуллин's suggestion), but I don't think you're going to like it:
autocmd CursorMoved * norm!99zH
This prevents scrolling to the right by the incredibly precise method of just ...
EDIT The problem was actually a bug in neovim fixed by the commit 47b7b471fa which is now merged in master.
So after asking the Neovim issue tracker it turns out this is the current "expected" behavior of the code:
In terminal.c the function adjust_topline() iterates over FOR_ALL_WINDOWS_IN_TAB, changing that to iterate over FOR_ALL_TAB_WINDOWS fixes my ...
I guess you want the horizontal scrollbar on nowrap.
You can handle this with a autocmd, like:
autocmd OptionSet wrap if &wrap|set guioptions-=b|else|set guioptions+=b|endif
If you change the option wrap during runtime, this will automatically switch on/off the horizontal scrollbar. The autocommand is not triggered on startup (sourcing vimrc), see :...
au BufWinEnter * exe "normal zz"
But I guess there will be side effects. Test thoroughly.
One side effect: Assume you have 2 buffers loaded and Vim has only one ("full terminal") window. So one buffer is displayed. The other is hidden. If you switch to the hidden buffer, zz will be executed.
You could create a mapping and use it instead of using zi. Create a mark for the current position and one for the top of the visible buffer, apply zi, move to the top, move the buffer, then move back to the original position.
nnoremap <Leader>zi maHmb'azi'bzt`a