Compare commits

..

4 Commits
v13.1.0 ... ai

Author SHA1 Message Date
725469adba refactor: move ai extras to ai instead of coding 2024-11-10 11:25:55 +01:00
b9dae57961 perf(ui): only enable treesitter folds if the buffer has treesitter highlighting 2024-11-09 23:33:05 +01:00
24665fc736 feat(keymaps): leader-bo to close other buffers 2024-11-09 16:13:11 +01:00
9c9e650530 fix(extras): fix alpha-nvim non-string keycodes (#4735)
## Description

The `dashboard.button` function provided by alpha-nvim expects a string
keybind, not a function:


https://github.com/goolord/alpha-nvim/blob/main/lua/alpha/themes/dashboard.lua#L63

## Related Issue(s)

Fixes https://github.com/LazyVim/LazyVim/issues/3728.

## Checklist

- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
2024-11-09 15:57:48 +01:00
10 changed files with 20 additions and 6 deletions

View File

@ -135,7 +135,7 @@ local defaults = {
}
M.json = {
version = 6,
version = 7,
path = vim.g.lazyvim_json or vim.fn.stdpath("config") .. "/lazyvim.json",
data = {
version = nil, ---@type string?

View File

@ -40,6 +40,9 @@ map("n", "<leader>`", "<cmd>e #<cr>", { desc = "Switch to Other Buffer" })
map("n", "<leader>bd", function()
Snacks.bufdelete()
end, { desc = "Delete Buffer" })
map("n", "<leader>bo", function()
Snacks.bufdelete.other()
end, { desc = "Delete Other Buffers" })
map("n", "<leader>bD", "<cmd>:bd<cr>", { desc = "Delete Buffer and Window" })
-- Clear search with <esc>

View File

@ -23,11 +23,11 @@ return {
dashboard.section.header.val = vim.split(logo, "\n")
-- stylua: ignore
dashboard.section.buttons.val = {
dashboard.button("f", "" .. " Find file", LazyVim.pick()),
dashboard.button("f", "" .. " Find file", "<cmd> lua LazyVim.pick()() <cr>"),
dashboard.button("n", "" .. " New file", [[<cmd> ene <BAR> startinsert <cr>]]),
dashboard.button("r", "" .. " Recent files", LazyVim.pick("oldfiles")),
dashboard.button("g", "" .. " Find text", LazyVim.pick("live_grep")),
dashboard.button("c", "" .. " Config", LazyVim.pick.config_files()),
dashboard.button("r", "" .. " Recent files", [[<cmd> lua LazyVim.pick("oldfiles")() <cr>]]),
dashboard.button("g", "" .. " Find text", [[<cmd> lua LazyVim.pick("live_grep")() <cr>]]),
dashboard.button("c", "" .. " Config", "<cmd> lua LazyVim.pick.config_files()() <cr>"),
dashboard.button("s", "" .. " Restore Session", [[<cmd> lua require("persistence").load() <cr>]]),
dashboard.button("x", "" .. " Lazy Extras", "<cmd> LazyExtras <cr>"),
dashboard.button("l", "󰒲 " .. " Lazy", "<cmd> Lazy <cr>"),

View File

@ -7,7 +7,6 @@ return {
keys = {
{ "<leader>bp", "<Cmd>BufferLineTogglePin<CR>", desc = "Toggle Pin" },
{ "<leader>bP", "<Cmd>BufferLineGroupClose ungrouped<CR>", desc = "Delete Non-Pinned Buffers" },
{ "<leader>bo", "<Cmd>BufferLineCloseOthers<CR>", desc = "Delete Other Buffers" },
{ "<leader>br", "<Cmd>BufferLineCloseRight<CR>", desc = "Delete Buffers to the Right" },
{ "<leader>bl", "<Cmd>BufferLineCloseLeft<CR>", desc = "Delete Buffers to the Left" },
{ "<S-h>", "<cmd>BufferLineCyclePrev<cr>", desc = "Prev Buffer" },

View File

@ -90,6 +90,13 @@ function M.migrate()
json.data.extras = vim.tbl_filter(function(extra)
return not (extra == "lazyvim.plugins.extras.editor.trouble-v3")
end, json.data.extras or {})
elseif json.data.version == 6 then
local ai = { "copilot", "codeium", "copilot-chat", "tabnine" }
json.data.extras = vim.tbl_map(function(extra)
return extra:gsub("^lazyvim%.plugins%.extras%.coding%.(.*)$", function(name)
return vim.tbl_contains(ai, name) and ("lazyvim.plugins.extras.ai." .. name) or extra
end)
end, json.data.extras or {})
end
M.save()

View File

@ -53,6 +53,11 @@ local skip_check = assert(vim.uv.new_check())
function M.foldexpr()
local buf = vim.api.nvim_get_current_buf()
-- no highlight, no foldexpr
if not vim.b[buf].ts_highlight then
return "0"
end
-- still in the same tick and no parser
if M.skip_foldexpr[buf] then
return "0"