goolord / alpha-nvim

a lua powered greeter like vim-startify / dashboard-nvim
MIT License
1.78k stars 104 forks source link

feat: Hide cursor, use highlight instead #208

Closed mizlan closed 1 year ago

mizlan commented 1 year ago

Using the tip here, I have made my cursor invisible. Combined with set cursorline, my alpha now looks like the following:

Screen Shot 2023-04-29 at 4 25 06 PM

However, I dislike the look of the cursorline highlight going all the way across, and would prefer if it were a 1-2 char padding on each side of the buttons. That would require making a custom highlight and related shenanigans. I am aware this will probably have a bit of performance drawback compared to the way it is right now, but it is a feature I am willing to pursue. If you'd like, I can try making a PR for this.

goolord commented 1 year ago

go for it! i think it would be nice as an opt-in feature. in the past, hiding the cursor has been broken by neovim updates. is there a reliable, non-hacky way to do that now?

mizlan commented 1 year ago

is there a reliable, non-hacky way to do that now

I am not sure how hacky justinmk's comment is, but I was planning on implementing it that way

mizlan commented 1 year ago

On second thought I don't know enough about how the plugin works as a whole, having only really touched buttons and the header and nothing else at all..

goolord commented 1 year ago

my suggestion is to write a function which locally sets the

  1. hides the cursor
  2. sets the cursorline highlight

and then stick it in enable_alpha https://github.com/goolord/alpha-nvim/blob/main/lua/alpha.lua#L479 with a boolean option in conf.opts

mizlan commented 1 year ago

I would not be writing this PR for myself in that case... like I said earlier, I would not like the highlight to go all the way across the window, but rather end shortly after each end of the text on either side. This would require using an extmark with a highlight I believe and setting its highlight manually, and adjusting it manually. An additional touch would be the highlight fading in and out with a transition with a duration, but now I'm just daydreaming. I might try to make my own PoC at some point...