diff options
| author | LostNeophyte <[email protected]> | 2022-11-29 08:50:24 +0100 | 
|---|---|---|
| committer | GitHub <[email protected]> | 2022-11-29 08:50:24 +0100 | 
| commit | f5454fb86087f9f7372f3be7af797d9dc0297d6e (patch) | |
| tree | e73190e39b1d7710774278bd9d6ee6e44eb67108 /lua/lvim/core/alpha/dashboard.lua | |
| parent | 84ce0803e119a961106ddd88896366ad58989167 (diff) | |
feat(alpha): allow configuring highlight groups (#3532)
* fix(alpha): make highlights overridable
Co-authored-by: CPea <[email protected]>
* feat: make opts overridable
* refactor: add default autostart to opts
* feat: default_button_opts
* Apply suggestions from code review
Co-authored-by: kylo252 <[email protected]>
Co-authored-by: CPea <[email protected]>
Co-authored-by: kylo252 <[email protected]>
Diffstat (limited to 'lua/lvim/core/alpha/dashboard.lua')
| -rw-r--r-- | lua/lvim/core/alpha/dashboard.lua | 40 | 
1 files changed, 17 insertions, 23 deletions
| diff --git a/lua/lvim/core/alpha/dashboard.lua b/lua/lvim/core/alpha/dashboard.lua index a1ba7c5a..26c7e053 100644 --- a/lua/lvim/core/alpha/dashboard.lua +++ b/lua/lvim/core/alpha/dashboard.lua @@ -114,31 +114,25 @@ function M.get_sections()        hl = "Number",      },    } -  local buttons = {} -  local status_ok, dashboard = pcall(require, "alpha.themes.dashboard") -  if status_ok then -    local function button(sc, txt, keybind, keybind_opts) -      local b = dashboard.button(sc, txt, keybind, keybind_opts) -      b.opts.hl_shortcut = "Include" -      return b -    end -    buttons = { -      val = { -        button("f", lvim.icons.ui.FindFile .. "  Find File", "<CMD>Telescope find_files<CR>"), -        button("n", lvim.icons.ui.NewFile .. "  New File", "<CMD>ene!<CR>"), -        button("p", lvim.icons.ui.Project .. "  Projects ", "<CMD>Telescope projects<CR>"), -        button("r", lvim.icons.ui.History .. "  Recent files", ":Telescope oldfiles <CR>"), -        button("t", lvim.icons.ui.FindText .. "  Find Text", "<CMD>Telescope live_grep<CR>"), -        button( -          "c", -          lvim.icons.ui.Gear .. "  Configuration", -          "<CMD>edit " .. require("lvim.config"):get_user_config_path() .. " <CR>" -        ), +  local buttons = { +    opts = { +      hl_shortcut = "Include", +      spacing = 1, +    }, +    entries = { +      { "f", lvim.icons.ui.FindFile .. "  Find File", "<CMD>Telescope find_files<CR>" }, +      { "n", lvim.icons.ui.NewFile .. "  New File", "<CMD>ene!<CR>" }, +      { "p", lvim.icons.ui.Project .. "  Projects ", "<CMD>Telescope projects<CR>" }, +      { "r", lvim.icons.ui.History .. "  Recent files", ":Telescope oldfiles <CR>" }, +      { "t", lvim.icons.ui.FindText .. "  Find Text", "<CMD>Telescope live_grep<CR>" }, +      { +        "c", +        lvim.icons.ui.Gear .. "  Configuration", +        "<CMD>edit " .. require("lvim.config"):get_user_config_path() .. " <CR>",        }, -    } -  end - +    }, +  }    return {      header = header,      buttons = buttons, | 
