Compare commits

..

6 Commits

Author SHA1 Message Date
5c4bd7150e feat(snacks): use snacks.dashboard as the default dashboard. moved dashboard-nvim to extras. 2024-11-18 22:10:51 +01:00
0352f944c3 perf(ui): never show folds on dashboards 2024-11-18 21:27:36 +01:00
33557ae68b fix(lualine): dont show statusline on snacks_dashboard 2024-11-18 21:27:36 +01:00
6dcf5d7159 fix(tabnine): dont call CmpTabnineHub in build. Fixes #4828 2024-11-18 21:27:36 +01:00
5c5ae903c9 chore(build): auto-generate docs 2024-11-18 09:06:35 +00:00
af9553135d feat(copilot-chat): remove call to nvim-cmp integration (#4822)
nvim-cmp integration was removed in favour of custom autocomplete (it
was pointless trying to support all the new completion plugins when its
15 lines to implement something plugin specific)

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
2024-11-18 10:05:28 +01:00
10 changed files with 111 additions and 75 deletions

View File

@ -2,6 +2,13 @@
## 13.x
- **LazyVim** now uses `Snacks.dashboard` as the default dashboard.
Check the [docs](https://github.com/folke/snacks.nvim/blob/main/docs/dashboard.md),
for more information and examples.
- A new [dashboard-nvim](https://github.com/nvimdev/dashboard-nvim) extra
is available for those who prefer the old dashboard.
- Big new release with a lot of changes and improvements!
- The biggest change is the move of a bunch of core features to

View File

@ -1,4 +1,4 @@
*LazyVim.txt* For Neovim Last change: 2024 November 16
*LazyVim.txt* For Neovim Last change: 2024 November 18
==============================================================================
Table of Contents *LazyVim-table-of-contents*

View File

@ -66,9 +66,6 @@ return {
},
config = function(_, opts)
local chat = require("CopilotChat")
if pcall(require, "cmp") then
require("CopilotChat.integrations.cmp").setup()
end
vim.api.nvim_create_autocmd("BufEnter", {
pattern = "copilot-chat",

View File

@ -8,7 +8,6 @@ return {
"tzachar/cmp-tabnine",
build = {
LazyVim.is_win() and "pwsh -noni .\\install.ps1" or "./install.sh",
":CmpTabnineHub",
},
dependencies = "hrsh7th/nvim-cmp",
opts = {

View File

@ -1,7 +1,6 @@
return {
{ "nvimdev/dashboard-nvim", enabled = false },
{ "echasnovski/mini.starter", enabled = false },
{ "folke/snacks.nvim", opts = { dashboard = { enabled = false } } },
-- Dashboard. This runs when neovim starts, and is what displays
-- the "LAZYVIM" banner.
{

View File

@ -0,0 +1,68 @@
return {
{ "folke/snacks.nvim", opts = { dashboard = { enabled = false } } },
{
"nvimdev/dashboard-nvim",
lazy = false, -- As https://github.com/nvimdev/dashboard-nvim/pull/450, dashboard-nvim shouldn't be lazy-loaded to properly handle stdin.
opts = function()
local logo = [[
██╗ █████╗ ███████╗██╗ ██╗██╗ ██╗██╗███╗ ███╗ Z
██║ ██╔══██╗╚══███╔╝╚██╗ ██╔╝██║ ██║██║████╗ ████║ Z
██║ ███████║ ███╔╝ ╚████╔╝ ██║ ██║██║██╔████╔██║ z
██║ ██╔══██║ ███╔╝ ╚██╔╝ ╚██╗ ██╔╝██║██║╚██╔╝██║ z
███████╗██║ ██║███████╗ ██║ ╚████╔╝ ██║██║ ╚═╝ ██║
╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝
]]
logo = string.rep("\n", 8) .. logo .. "\n\n"
local opts = {
theme = "doom",
hide = {
-- this is taken care of by lualine
-- enabling this messes up the actual laststatus setting after loading a file
statusline = false,
},
config = {
header = vim.split(logo, "\n"),
-- stylua: ignore
center = {
{ action = 'lua LazyVim.pick()()', desc = " Find File", icon = "", key = "f" },
{ action = "ene | startinsert", desc = " New File", icon = "", key = "n" },
{ action = 'lua LazyVim.pick("oldfiles")()', desc = " Recent Files", icon = "", key = "r" },
{ action = 'lua LazyVim.pick("live_grep")()', desc = " Find Text", icon = "", key = "g" },
{ action = 'lua LazyVim.pick.config_files()()', desc = " Config", icon = "", key = "c" },
{ action = 'lua require("persistence").load()', desc = " Restore Session", icon = "", key = "s" },
{ action = "LazyExtras", desc = " Lazy Extras", icon = "", key = "x" },
{ action = "Lazy", desc = " Lazy", icon = "󰒲 ", key = "l" },
{ action = function() vim.api.nvim_input("<cmd>qa<cr>") end, desc = " Quit", icon = "", key = "q" },
},
footer = function()
local stats = require("lazy").stats()
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
return { "⚡ Neovim loaded " .. stats.loaded .. "/" .. stats.count .. " plugins in " .. ms .. "ms" }
end,
},
}
for _, button in ipairs(opts.config.center) do
button.desc = button.desc .. string.rep(" ", 43 - #button.desc)
button.key_format = " %s"
end
-- open dashboard after closing lazy
if vim.o.filetype == "lazy" then
vim.api.nvim_create_autocmd("WinClosed", {
pattern = tostring(vim.api.nvim_get_current_win()),
once = true,
callback = function()
vim.schedule(function()
vim.api.nvim_exec_autocmds("UIEnter", { group = "dashboard" })
end)
end,
})
end
return opts
end,
},
}

View File

@ -1,8 +1,7 @@
-- start screen
return {
-- disable alpha
{ "goolord/alpha-nvim", enabled = false },
{ "nvimdev/dashboard-nvim", enabled = false },
{ "folke/snacks.nvim", opts = { dashboard = { enabled = false } } },
-- enable mini.starter
{

View File

@ -30,11 +30,9 @@ return {
opts = function()
---@type snacks.Config
return {
bigfile = { enabled = true },
notifier = { enabled = true },
quickfile = { enabled = true },
bigfile = { enabled = true },
words = { enabled = true },
toggle = { map = LazyVim.safe_keymap_set },
statuscolumn = { enabled = false }, -- we set this in options.lua
terminal = {
win = {
@ -46,6 +44,8 @@ return {
},
},
},
toggle = { map = LazyVim.safe_keymap_set },
words = { enabled = true },
}
end,
keys = {

View File

@ -84,7 +84,7 @@ return {
options = {
theme = "auto",
globalstatus = vim.o.laststatus == 3,
disabled_filetypes = { statusline = { "dashboard", "alpha", "ministarter" } },
disabled_filetypes = { statusline = { "dashboard", "alpha", "ministarter", "snacks_dashboard" } },
},
sections = {
lualine_a = { "mode" },
@ -307,68 +307,31 @@ return {
{ "MunifTanjim/nui.nvim", lazy = true },
{
"nvimdev/dashboard-nvim",
lazy = false, -- As https://github.com/nvimdev/dashboard-nvim/pull/450, dashboard-nvim shouldn't be lazy-loaded to properly handle stdin.
opts = function()
local logo = [[
██╗ █████╗ ███████╗██╗ ██╗██╗ ██╗██╗███╗ ███╗ Z
██║ ██╔══██╗╚══███╔╝╚██╗ ██╔╝██ ██║██║████╗ ████║ Z
██║ ███████║ ███╔╝ ╚████╔╝ ██║ ██║██║████████║ z
██║ ██╔══██║ ███╔╝ ╚██╔╝ ╚██╗ ██╔╝██║██║╚██╔██║ z
███████╗██║ ██║███████╗ ██ ╚████╔╝ ██║██║ ╚═╝ ██║
╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝
]]
logo = string.rep("\n", 8) .. logo .. "\n\n"
local opts = {
theme = "doom",
hide = {
-- this is taken care of by lualine
-- enabling this messes up the actual laststatus setting after loading a file
statusline = false,
},
config = {
header = vim.split(logo, "\n"),
-- stylua: ignore
center = {
{ action = 'lua LazyVim.pick()()', desc = " Find File", icon = "", key = "f" },
{ action = "ene | startinsert", desc = " New File", icon = "", key = "n" },
{ action = 'lua LazyVim.pick("oldfiles")()', desc = " Recent Files", icon = "", key = "r" },
{ action = 'lua LazyVim.pick("live_grep")()', desc = " Find Text", icon = "", key = "g" },
{ action = 'lua LazyVim.pick.config_files()()', desc = " Config", icon = "", key = "c" },
{ action = 'lua require("persistence").load()', desc = " Restore Session", icon = "", key = "s" },
{ action = "LazyExtras", desc = " Lazy Extras", icon = "", key = "x" },
{ action = "Lazy", desc = " Lazy", icon = "󰒲 ", key = "l" },
{ action = function() vim.api.nvim_input("<cmd>qa<cr>") end, desc = " Quit", icon = "", key = "q" },
},
footer = function()
local stats = require("lazy").stats()
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
return { "⚡ Neovim loaded " .. stats.loaded .. "/" .. stats.count .. " plugins in " .. ms .. "ms" }
"folke/snacks.nvim",
opts = {
dashboard = {
preset = {
header = [[
██╗ █████╗ ███████╗██╗ ██╗██ ██╗██╗███╗ ███ Z
██║ ██╔══██╗╚══███╔╝╚████╔╝██║ ██║██║████████║ Z
██║ ██████║ ███╔╝ ╚██╔╝ ██║ ████║██╔████╔██║ z
██║ ██╔══██║ ███╔╝ ██╔╝ ╚████╔╝██║██║╚██╔╝██║ z
███████╗██║ ██║███████╗ ██║ ╚████╔╝ ██║██║ ╚═╝ ██║
╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝
]],
---@param keys snacks.dashboard.Item[]
keys = function(keys)
-- add LazyExtra before Lazy
for k, key in ipairs(keys) do
if key.action == ":Lazy" then
key.key = "l" -- we don't have multiple panes, so `l` is free
table.insert(keys, k, { icon = "", desc = "Lazy Extras", action = ":LazyExtras", key = "x" })
break
end
end
end,
},
}
for _, button in ipairs(opts.config.center) do
button.desc = button.desc .. string.rep(" ", 43 - #button.desc)
button.key_format = " %s"
end
-- open dashboard after closing lazy
if vim.o.filetype == "lazy" then
vim.api.nvim_create_autocmd("WinClosed", {
pattern = tostring(vim.api.nvim_get_current_win()),
once = true,
callback = function()
vim.schedule(function()
vim.api.nvim_exec_autocmds("UIEnter", { group = "dashboard" })
end)
end,
})
end
return opts
end,
},
},
},
}

View File

@ -15,7 +15,11 @@ function M.foldexpr()
if vim.bo[buf].filetype == "" then
return "0"
end
vim.b[buf].ts_folds = pcall(vim.treesitter.get_parser, buf)
if vim.bo[buf].filetype:find("dashboard") then
vim.b[buf].ts_folds = false
else
vim.b[buf].ts_folds = pcall(vim.treesitter.get_parser, buf)
end
end
return vim.b[buf].ts_folds and vim.treesitter.foldexpr() or "0"
end