feat(core)!: move a bunch of LazyVim features to snacks.nvim (#4706)

## Description

LazyVim comes with a bunch of smaller QoL plugin like features, but it's
not easy for non LazyVim users to use them.

That's why I started working on
[snacks.nvim](https://github.com/folke/snacks.nvim), a collection of
small QoL plugins for Neovim.

Snacks also includes a bunch of new improvements to these features.

This PR fully integrates with snacks.

## Todo

- [ ] add proper deprecations where needed
- [ ] create snacks docs
- [ ] document all the new improvements relevant to LazyVim users

## Closes

- [ ] #4492 
- [ ] #4333
- [ ] #4687

## Screenshots

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

## Checklist

- [ ] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
This commit is contained in:
Folke Lemaitre 2024-11-07 15:54:47 +01:00 committed by GitHub
parent 75750be1c0
commit 2f4697443c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
29 changed files with 277 additions and 1066 deletions

View file

@ -10,7 +10,48 @@ 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 {
toggle = { map = LazyVim.safe_keymap_set },
notifier = { enabled = not LazyVim.has("noice.nvim") },
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" },
},
},
},
}
end,
keys = {
{
"<leader>un",
function()
Snacks.notifier.hide()
end,
desc = "Dismiss All Notifications",
},
},
},
}