otavioschwanck / arrow.nvim

Bookmark your files, separated by project, and quickly navigate through them.
Other
341 stars 16 forks source link

Feature: Option to center the cursor (`zz`) if below center #70

Open keiviv opened 2 weeks ago

keiviv commented 2 weeks ago

Amazing plugin, and an option to auto-zz if below center would be useful. I've tried to add it in custom_actions, but it needs to be after the return, and also work on previous • next. The code is quite simple to implement:

if vim.fn.line('.') > vim.fn.winheight(0) / 2 then
   vim.cmd('normal! zz')
end

or similar. The option name could be smart_center.

tingey21 commented 1 week ago

I'll take a look at this in a little 👀 I do love me some auto centering