mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-22 00:49:03 +02:00
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:
parent
75750be1c0
commit
2f4697443c
29 changed files with 277 additions and 1066 deletions
|
@ -1,39 +1,4 @@
|
|||
return {
|
||||
-- Better `vim.notify()`
|
||||
{
|
||||
"rcarriga/nvim-notify",
|
||||
keys = {
|
||||
{
|
||||
"<leader>un",
|
||||
function()
|
||||
require("notify").dismiss({ silent = true, pending = true })
|
||||
end,
|
||||
desc = "Dismiss All Notifications",
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
stages = "static",
|
||||
timeout = 3000,
|
||||
max_height = function()
|
||||
return math.floor(vim.o.lines * 0.75)
|
||||
end,
|
||||
max_width = function()
|
||||
return math.floor(vim.o.columns * 0.75)
|
||||
end,
|
||||
on_open = function(win)
|
||||
vim.api.nvim_win_set_config(win, { zindex = 100 })
|
||||
end,
|
||||
},
|
||||
init = function()
|
||||
-- when noice is not enabled, install notify on VeryLazy
|
||||
if not LazyVim.has("noice.nvim") then
|
||||
LazyVim.on_very_lazy(function()
|
||||
vim.notify = require("notify")
|
||||
end)
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- This is what powers LazyVim's fancy-looking
|
||||
-- tabs, which include filetype icons and close buttons.
|
||||
{
|
||||
|
@ -55,9 +20,9 @@ return {
|
|||
opts = {
|
||||
options = {
|
||||
-- stylua: ignore
|
||||
close_command = function(n) LazyVim.ui.bufremove(n) end,
|
||||
close_command = function(n) Snacks.bufdelete(n) end,
|
||||
-- stylua: ignore
|
||||
right_mouse_command = function(n) LazyVim.ui.bufremove(n) end,
|
||||
right_mouse_command = function(n) Snacks.bufdelete(n) end,
|
||||
diagnostics = "nvim_lsp",
|
||||
always_show_bufferline = false,
|
||||
diagnostics_indicator = function(_, _, diag)
|
||||
|
@ -226,7 +191,7 @@ return {
|
|||
"lukas-reineke/indent-blankline.nvim",
|
||||
event = "LazyFile",
|
||||
opts = function()
|
||||
LazyVim.toggle.map("<leader>ug", {
|
||||
Snacks.toggle({
|
||||
name = "Indention Guides",
|
||||
get = function()
|
||||
return require("ibl.config").get_config(0).enabled
|
||||
|
@ -234,7 +199,7 @@ return {
|
|||
set = function(state)
|
||||
require("ibl").setup_buffer(0, { enabled = state })
|
||||
end,
|
||||
})
|
||||
}):map("<leader>ug")
|
||||
|
||||
return {
|
||||
indent = {
|
||||
|
@ -244,17 +209,19 @@ return {
|
|||
scope = { show_start = false, show_end = false },
|
||||
exclude = {
|
||||
filetypes = {
|
||||
"help",
|
||||
"Trouble",
|
||||
"alpha",
|
||||
"dashboard",
|
||||
"neo-tree",
|
||||
"Trouble",
|
||||
"trouble",
|
||||
"help",
|
||||
"lazy",
|
||||
"mason",
|
||||
"neo-tree",
|
||||
"notify",
|
||||
"snacks_notif",
|
||||
"snacks_terminal",
|
||||
"snacks_win",
|
||||
"toggleterm",
|
||||
"lazyterm",
|
||||
"trouble",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue