NvChad / NvChad

Blazing fast Neovim config providing solid defaults and a beautiful UI, enhancing your neovim experience.
https://nvchad.com/
GNU General Public License v3.0
24.44k stars 2.11k forks source link

how to use base46 for alpha-nvim #2488

Closed Cyberczy closed 10 months ago

Cyberczy commented 10 months ago

Is your feature request related to a problem? Please describe. Hi , I'am a new with neovim, and i'am struggling with nvChad configuration: I can't use base46 for alpha-nvim

Describe the solution you'd like When I use alpha-nvim,it like this image

I want it to go like this

image

Describe alternatives you've considered I try to require("base46"), but failed

Additional context my config of alpha-nvim

return {
  "goolord/alpha-nvim",
  dependencies = { "nvim-tree/nvim-web-devicons" },
  event = "VimEnter",
  cmd = "Alpha",
  config = function()
    local dashboard = require "alpha.themes.dashboard"
    dashboard.section.header.val = {
      [[                                                                       ]],
      [[                                                                     ]],
      [[       ████ ██████           █████      ██                     ]],
      [[      ███████████             █████                             ]],
      [[      █████████ ███████████████████ ███   ███████████   ]],
      [[     █████████  ███    █████████████ █████ ██████████████   ]],
      [[    █████████ ██████████ █████████ █████ █████ ████ █████   ]],
      [[  ███████████ ███    ███ █████████ █████ █████ ████ █████  ]],
      [[ ██████  █████████████████████ ████ █████ █████ ████ ██████ ]],
      [[                                                                       ]],
    }
    dashboard.section.header.opts.hl = "DashboardHeader"
    dashboard.config.layout[1].val = vim.fn.max { 2, vim.fn.floor(vim.fn.winheight(0) * 0.2) }
    dashboard.config.layout[3].val = 3
    dashboard.config.opts.noautocmd = true
    require("alpha").setup(dashboard.config)

    vim.api.nvim_create_autocmd({ "User" }, {
      pattern = "LazyVimStarted",
      desc = "Add Alpha dashboard footer",
      once = true,
      callback = function()
        local stats = require("lazy").stats()
        local ms = math.floor(stats.startuptime * 100 + 0.5) / 100
        dashboard.section.footer.val = {
          "   Have Fun with NvChad"
            .. "  󰀨 v"
            .. vim.version().major
            .. "."
            .. vim.version().minor
            .. "."
            .. vim.version().patch
            .. "  ⚡NvChad loaded "
            .. stats.count
            .. " plugins  in "
            .. ms
            .. "ms",
        }
        dashboard.section.footer.opts.hl = "DashboardFooter"
        pcall(vim.cmd.AlphaRedraw)
      end,
    })
  end,
}
Cyberczy commented 10 months ago

I have solved the problem