nvim-lualine / lualine.nvim

A blazing fast and easy to configure neovim statusline plugin written in pure lua.
MIT License
5.93k stars 462 forks source link

Feat: Location: `Top` and `Bot` when at the top or bottom of the buffer #737

Closed WhyNotHugo closed 2 years ago

WhyNotHugo commented 2 years ago

Didn't find any issues or mentions of this.

Requested feature

Vim itself shows Top and Bot (for Bottom) when one scrolls to the top or bottom of the buffer.

I'd appreciate the location module doing the same.

Seems that this should be done here: https://github.com/nvim-lualine/lualine.nvim/blob/ad4f4ff7515990b5b2a01bc3933346e11ebf0301/lua/lualine/components/location.lua#L3

Motivation

Lualine is a big upgrade on the vanilla statuslines, but this is one tiny feature the vanilla one has that I'd like to retain.

I can try figuring out a patch to do this if it sounds okay.

shadmansaleh commented 2 years ago

You can just use the vanilla one with lualine. You just need to use %P in place of location. Checkout :h stl to see other builtin statusline format specifiers and read the README to know how you can customize lualine.

lualine_z = {'%P'}
WhyNotHugo commented 2 years ago

Thanks!

WhyNotHugo commented 2 years ago

Oh, the built-in one also render "All" when the whole file fits on screen.