Skip to content

Commit

Permalink
feat: configure leader shortcut string
Browse files Browse the repository at this point in the history
  • Loading branch information
goolord committed Feb 27, 2022
1 parent 8a0f62e commit 78e48d7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion lua/alpha/themes/dashboard.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ local footer = {
},
}

local leader = "SPC"

--- @param sc string
--- @param txt string
--- @param keybind string optional
--- @param keybind_opts table optional
local function button(sc, txt, keybind, keybind_opts)
local sc_ = sc:gsub("%s", ""):gsub("SPC", "<leader>")
local sc_ = sc:gsub("%s", ""):gsub(leader, "<leader>")

local opts = {
position = "center",
Expand Down Expand Up @@ -98,6 +100,8 @@ return {
button = button,
section = section,
config = config,
-- theme config
leader = leader,
-- deprecated
opts = config,
}
8 changes: 6 additions & 2 deletions lua/alpha/themes/startify.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ local default_header = {
},
}

local leader = "SPC"

--- @param sc string
--- @param txt string
--- @param keybind string optional
--- @param keybind_opts table optional
local function button(sc, txt, keybind, keybind_opts)
local sc_ = sc:gsub("%s", ""):gsub("SPC", "<leader>")
local sc_ = sc:gsub("%s", ""):gsub(leader, "<leader>")

local opts = {
position = "left",
Expand Down Expand Up @@ -237,11 +239,13 @@ return {
icon = icon,
button = button,
file_button = file_button,
nvim_web_devicons = nvim_web_devicons,
mru = mru,
mru_opts = mru_opts,
section = section,
config = config,
-- theme config
nvim_web_devicons = nvim_web_devicons,
leader = leader,
-- deprecated
opts = config,
}

0 comments on commit 78e48d7

Please sign in to comment.