sontungexpt / sttusline

A very lightweight, super fast and lazyloading statusline plugin for Neovim written in lua.
MIT License
107 stars 7 forks source link

Question: how to make airline-like statusline? #17

Open linrongbin16 opened 5 months ago

linrongbin16 commented 5 months ago

Hi,

I found it's very difficult to render the left slant, right slant icons to make an airline-like statusline.

Would you please share some knowledge on that?

My config is here: https://github.com/linrongbin16/lin.nvim/pull/464/files#diff-0d8b193648b49d94453058fdc06f50c994b6a80b16a223188af9e0852ea02c6aR269-R270

linrongbin16 commented 5 months ago

update:

I found the reason that crash the border between two components, is the separator and padding option:

image

Does the colors in a component also cover the text in separator and padding option?

sontungexpt commented 5 months ago

update:

I found the reason that crash the border between two components, is the separator and padding option:

image

Does the colors in a component also cover the text in separator and padding option?

Apologies for the delay in response; I'm currently immersed in the Lunar New Year festivities. I've implemented color schemes for the separators, but I'm contemplating whether to include highlights for the padding. What are your thoughts?

linrongbin16 commented 5 months ago

hi @sontungexpt , I'm in Shanghai China, so Happy new year!

For user like me, I think the proper design is: let colors take effect on whole component, including padding options. If user want a padding, they can create a new component for that.

Your plugin is actually very close to heirline.nvim, also I guess padding and separator option is from lualine.nvim.

You could take a look at heirline, I feel like it's the best statusline plugin that support fully customizations.

I'm now using heirline, please see my config:https://github.com/linrongbin16/lin.nvim/pull/470/files#diff-e80bc0191eeb8f27cd694d6618e4c9b8e52ca91108ae3ec0374eeec7f3798d64

Personal advise:

  1. remove padding, separator options, users can create their paddings and separators with a component, your plugin just need to render.
  2. Pay attention to the component and its child components, the tree-like data structure is very important.
  3. Try provide caching, so users can make calculating async, so it will have better performance.
  4. Try provider auto-theme based on current colorscheme. It's a very hard part for user. It needs to retrieve RGB colors from highlight groups, and adjust these colors to brighter or darker, to give user a color that makes user feel better.

At last, you can merge table_version branch into main branch, don't worry about break changes, just always use the best design and solution for your project.

sontungexpt commented 5 months ago

Hi, can your write by english. I know we all have lunar new year, but i'm from vietnam, your neigbour.