Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Center for groups #18

Open
Mte90 opened this issue Sep 10, 2021 · 5 comments
Open

Center for groups #18

Mte90 opened this issue Sep 10, 2021 · 5 comments
Labels
enhancement New feature or request

Comments

@Mte90
Copy link
Contributor

Mte90 commented Sep 10, 2021

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.

@goolord goolord added the enhancement New feature or request label Sep 10, 2021
@goolord
Copy link
Owner

goolord commented Dec 12, 2021

@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
Copy link
Owner

goolord commented Dec 12, 2021

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

@Dukihung
Copy link

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

@goolord
Copy link
Owner

goolord commented Feb 11, 2023

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

@andersonfelix
Copy link

I used theta config:

local alpha = require("alpha")
local config = require("alpha.themes.theta").config
-- there's no name, access via index
config.layout[2].val = {} // my ascii
alpha.setup(config)

Neovim ascii

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants