LazyVim.LazyVim/lua/lazyvim/plugins/init.lua
Folke Lemaitre a07db1a723
feat(snacks): use snacks.dashboard as the default dashboard. moved dashboard-nvim to extras (#4832)
## Description

<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->

Snacks has a new dashboard plugin that will be LazyVim's default.

Check the docs at
https://github.com/folke/snacks.nvim/blob/main/docs/dashboard.md

## Related Issue(s)

<!--
  If this PR fixes any issues, please link to the issue here.
  - Fixes #<issue_number>
-->

## Screenshots

<!-- Add screenshots of the changes if applicable. -->

## Checklist

- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
2024-11-18 23:32:49 +01:00

61 lines
1.7 KiB
Lua

if vim.fn.has("nvim-0.9.0") == 0 then
vim.api.nvim_echo({
{ "LazyVim requires Neovim >= 0.9.0\n", "ErrorMsg" },
{ "Press any key to exit", "MoreMsg" },
}, true, {})
vim.fn.getchar()
vim.cmd([[quit]])
return {}
end
require("lazyvim.config").init()
-- Terminal Mappings
local function term_nav(dir)
---@param self snacks.terminal
return function(self)
return self:is_floating() and "<c-" .. dir .. ">" or vim.schedule(function()
vim.cmd.wincmd(dir)
end)
end
end
return {
{ "folke/lazy.nvim", version = "*" },
{ "LazyVim/LazyVim", priority = 10000, lazy = false, opts = {}, cond = true, version = "*" },
{
"folke/snacks.nvim",
priority = 1000,
lazy = false,
opts = function()
---@type snacks.Config
return {
bigfile = { enabled = true },
notifier = { enabled = true },
quickfile = { enabled = true },
statuscolumn = { enabled = false }, -- we set this in options.lua
terminal = {
win = {
keys = {
nav_h = { "<C-h>", term_nav("h"), desc = "Go to Left Window", expr = true, mode = "t" },
nav_j = { "<C-j>", term_nav("j"), desc = "Go to Lower Window", expr = true, mode = "t" },
nav_k = { "<C-k>", term_nav("k"), desc = "Go to Upper Window", expr = true, mode = "t" },
nav_l = { "<C-l>", term_nav("l"), desc = "Go to Right Window", expr = true, mode = "t" },
},
},
},
toggle = { map = LazyVim.safe_keymap_set },
words = { enabled = true },
}
end,
keys = {
{
"<leader>un",
function()
Snacks.notifier.hide()
end,
desc = "Dismiss All Notifications",
},
},
},
}