Keep current line in centre of window

https://vim.fandom.com/wiki/Keep_your_cursor_centered_vertically_on_the_screen
This commit is contained in:
Anthony Rose 2023-01-13 13:00:31 +00:00
parent ac3709eb2a
commit 5a00c2967a

6
vimrc
View file

@ -146,6 +146,12 @@ if has('autocmd')
autocmd User GoyoEnter nested call <SID>goyo_enter() autocmd User GoyoEnter nested call <SID>goyo_enter()
autocmd User GoyoLeave nested call <SID>goyo_leave() autocmd User GoyoLeave nested call <SID>goyo_leave()
augroup VCenterCursor
au!
au BufEnter,WinEnter,WinNew,VimResized *,*.*
\ let &scrolloff=winheight(win_getid())/2
augroup END
endif endif
if has('folding') if has('folding')