alpha-nvim icon indicating copy to clipboard operation
alpha-nvim copied to clipboard

Center for groups

Open Mte90 opened this issue 4 years ago • 5 comments

Looking at the code the position is not supported for groups but I am getting this: Screenshot_20210910_173013

I would like to have also groups centered.

Mte90 avatar Sep 10 '21 15:09 Mte90

@Mte90 what i do at the moment is that i have a width option https://github.com/goolord/alpha-nvim/blob/main/lua/alpha/themes/dashboard.lua#L40 which in conjunction with the center will make everything with the same width align properly

i do eventually want to have 'center' working for groups, it hasn't been a priority for me since this works so nicely for me already

goolord avatar Dec 12 '21 01:12 goolord

like, this should have the same effect as centering a group

local group = {
  type = "group"
  val = ...
}

for _, el in pairs(group.val) do
  el.opts.position = "center"
  el.opts.width = 50 -- or some other value
end

goolord avatar Dec 12 '21 02:12 goolord

Hi, how do i center in startify theme and add bookmarks?

Dukihung avatar Feb 11 '23 21:02 Dukihung

how to center startify: check out the https://github.com/goolord/alpha-nvim/blob/main/lua/alpha/themes/theta.lua theta theme, it's essentially that. you can copy this module and tweak it to define your own theme if you like.

to add bookmarks to theta you can do something like

local alpha = require'alpha'
local theta = require'alpha.themes.startify'
local dashboard = require'alpha.dashboard'
theta.buttons.val = {
    dashboard.button("c", "  configuration", "<cmd>cd ~/.config/nvim/ <cr>"),
    dashboard.button("n", "  notes", "<cmd>e ~/notes.md <cr>"),
}
alpha.setup(theta.config)

(the theta module could definitely use some TLC to have a more similar api to the other 2 themes)

@Dukihung

goolord avatar Feb 11 '23 21:02 goolord