feat(nvim): add a dashboard keymap that supports alpha and dashboard-nvim

This commit is contained in:
Sergio Laín 2024-03-17 01:51:40 +01:00
parent f0143c7241
commit 1c103c07de
No known key found for this signature in database
GPG key ID: 14C9B8080681777B
2 changed files with 9 additions and 3 deletions

View file

@ -154,3 +154,12 @@ map("x", "g/", "<esc>/\\%V", { silent = false, desc = "Search inside visual sele
-- Search visually selected text (slightly better than builtins in Neovim>=0.8)
map("x", "*", [[y/\V<C-R>=escape(@", '/\')<CR><CR>]])
map("x", "#", [[y?\V<C-R>=escape(@", '?\')<CR><CR>]])
-- Dashboard
map("n", "<leader>fd", function()
if Util.has("alpha-nvim") then
require("alpha").start(true)
elseif Util.has("dashboard-nvim") then
vim.cmd("Dashboard")
end
end, { desc = "Dashboard" })

View file

@ -18,7 +18,4 @@ return {
opts.config.header = vim.split(logo, "\n")
return opts
end,
keys = {
{ "<leader>fd", "<cmd>Dash<cr>", desc = "Dashboard" },
},
}