Merge branch 'main' into fix-vue

This commit is contained in:
xiaojianzheng 2024-06-15 02:11:03 +08:00 committed by GitHub
commit cb82b767b2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 117 additions and 14 deletions

View file

@ -75,7 +75,7 @@ body:
-- install plugins
local plugins = {
"folke/tokyonight.nvim",
"folke/LazyVim",
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
-- add any other plugins here
}
require("lazy").setup(plugins, {

View file

@ -1,5 +1,18 @@
# Changelog
## [12.14.1](https://github.com/LazyVim/LazyVim/compare/v12.14.0...v12.14.1) (2024-06-14)
### Bug Fixes
* **edgy:** only track other neo-tree windows with a source ([6efbdab](https://github.com/LazyVim/LazyVim/commit/6efbdabd1b2272401566354686ce85e1372fe925))
* **extras:** better reasons as to why some extras are included in your config. ([eeccbbc](https://github.com/LazyVim/LazyVim/commit/eeccbbc40721bb825182251acf201750741c77b2))
* **fzf:** esc and c-j, c-k keymaps with nowait. update fzf-lua as well ([c9380a3](https://github.com/LazyVim/LazyVim/commit/c9380a309dbdc9fe45ec1bc9f8f27700540c2eea))
* **fzf:** esc and nowait ([7c7703d](https://github.com/LazyVim/LazyVim/commit/7c7703d79226cda99b1ec3d25fbfff54af04ba5b))
* **fzf:** floating previewer closed fail ([#3638](https://github.com/LazyVim/LazyVim/issues/3638)) ([427e57d](https://github.com/LazyVim/LazyVim/commit/427e57ddf7030f7081d858d923fb9337f94bf0a7))
* **issue template:** repro.lua didn't work ([#3628](https://github.com/LazyVim/LazyVim/issues/3628)) ([25cccb5](https://github.com/LazyVim/LazyVim/commit/25cccb5db858ad0640fd6a9eb5da4c5f465749d9))
* **pick:** allow configuring pickers without LazyExtras. Fixes [#3626](https://github.com/LazyVim/LazyVim/issues/3626) ([304e743](https://github.com/LazyVim/LazyVim/commit/304e7439aa8ae646adafb737b292707bf77a31d9))
## [12.14.0](https://github.com/LazyVim/LazyVim/compare/v12.13.0...v12.14.0) (2024-06-13)

View file

@ -113,6 +113,10 @@ docker run -w /root -it --rm alpine:edge sh -uelic '
[![Watch the video](https://img.youtube.com/vi/N93cTbtLCIM/hqdefault.jpg)](https://www.youtube.com/watch?v=N93cTbtLCIM)
[@dusty-phillips](https://github.com/dusty-phillips) 正在编写一本名为
[LazyVim for Ambitious Developers](https://lazyvim-ambitious-devs.phillips.codes)
的书,该书可在线免费获得。
## 📂 文件结构
config 下的文件会在适当的时候自动加载,所以你不需要手动引入这些文件。

View file

@ -5,6 +5,12 @@ vim.g.maplocalleader = "\\"
-- LazyVim auto format
vim.g.autoformat = true
-- LazyVim picker to use.
-- Can be one of: telescope, fzf
-- Leave it to "auto" to automatically use the picker
-- enabled with `:LazyExtras`
vim.g.lazyvim_picker = "auto"
-- LazyVim root dir detection
-- Each entry can be:
-- * the name of a detector function like `lsp` or `cwd`

View file

@ -26,4 +26,13 @@ return {
"neovim/nvim-lspconfig",
dependencies = {},
},
-- dummy import to save core imports
{
import = "foobar",
enabled = function()
LazyVim.plugin.save_core()
return false
end,
},
}

View file

@ -236,8 +236,8 @@ return {
-- better diagnostics list and others
{
"folke/trouble.nvim",
cmd = { "TroubleToggle", "Trouble" },
opts = { use_diagnostic_signs = true },
cmd = { "Trouble" },
opts = {},
keys = {
{ "<leader>xx", "<cmd>Trouble diagnostics toggle<cr>", desc = "Diagnostics (Trouble)" },
{ "<leader>xX", "<cmd>Trouble diagnostics toggle filter.buf=0<cr>", desc = "Buffer Diagnostics (Trouble)" },
@ -301,13 +301,13 @@ return {
{
import = "lazyvim.plugins.extras.editor.fzf",
enabled = function()
return LazyVim.has_extra("editor.fzf")
return LazyVim.pick.want() == "fzf"
end,
},
{
import = "lazyvim.plugins.extras.editor.telescope",
enabled = function()
return not LazyVim.has_extra("editor.fzf")
return LazyVim.pick.want() == "telescope"
end,
},
}

View file

@ -1,3 +1,9 @@
if lazyvim_docs then
-- In case you don't want to use `:LazyExtras`,
-- then you need to set the option below.
vim.g.lazyvim_picker = "fzf"
end
---@class FzfLuaOpts: lazyvim.util.pick.Opts
---@field cmd string?
@ -155,9 +161,8 @@ return {
require("fzf-lua").register_ui_select(opts.ui_select or nil)
end,
keys = {
{ "<esc>", "<c-c>", ft = "fzf", mode = "t", nowait = true },
{ "<c-j>", "<Down>", ft = "fzf", mode = "t", nowait = true },
{ "<c-k>", "<Up>", ft = "fzf", mode = "t", nowait = true },
{ "<c-j>", "<c-j>", ft = "fzf", mode = "t", nowait = true },
{ "<c-k>", "<c-k>", ft = "fzf", mode = "t", nowait = true },
{
"<leader>,",
"<cmd>FzfLua buffers sort_mru=true sort_lastused=true<cr>",

View file

@ -1,3 +1,9 @@
if lazyvim_docs then
-- In case you don't want to use `:LazyExtras`,
-- then you need to set the option below.
vim.g.lazyvim_picker = "telescope"
end
local have_make = vim.fn.executable("make") == 1
local have_cmake = vim.fn.executable("cmake") == 1
@ -49,6 +55,9 @@ return {
{
"nvim-telescope/telescope.nvim",
cmd = "Telescope",
enabled = function()
return LazyVim.pick.want() == "telescope"
end,
version = false, -- telescope did only one release, so use HEAD for now
dependencies = {
{
@ -228,6 +237,9 @@ return {
{
"stevearc/dressing.nvim",
lazy = true,
enabled = function()
return LazyVim.pick.want() == "telescope"
end,
init = function()
---@diagnostic disable-next-line: duplicate-set-field
vim.ui.select = function(...)
@ -245,6 +257,9 @@ return {
{
"neovim/nvim-lspconfig",
opts = function()
if LazyVim.pick.want() ~= "telescope" then
return
end
local Keys = require("lazyvim.plugins.lsp.keymaps").get()
-- stylua: ignore
vim.list_extend(Keys, {

View file

@ -84,7 +84,14 @@ return {
pinned = true,
open = "Neotree position=top buffers",
},
"neo-tree",
{
title = "Neo-Tree Other",
ft = "neo-tree",
filter = function(buf)
return vim.b[buf].neo_tree_source ~= nil
end,
},
-- "neo-tree",
},
keys = {
-- increase width

View file

@ -20,8 +20,9 @@ local v = version.major .. "_" .. version.minor
local compat = { "0_9" }
LazyVim.plugin.save_core()
if vim.tbl_contains(compat, v) then
extras[#extras + 1] = "lazyvim.plugins.compat.nvim-" .. v
table.insert(extras, 1, "lazyvim.plugins.compat.nvim-" .. v)
end
table.sort(extras, function(a, b)

View file

@ -250,10 +250,30 @@ end
---@param extra LazyExtra
function X:extra(extra)
if not extra.managed then
self:diagnostic({
message = "Not managed by LazyExtras (config)",
severity = vim.diagnostic.severity.WARN,
})
---@type LazyExtra[]
local parents = {}
for _, x in ipairs(self.extras) do
if x.enabled and vim.tbl_contains(x.imports, extra.module) then
parents[#parents + 1] = x
end
end
if #parents > 0 then
local pp = vim.tbl_map(function(x)
return x.name
end, parents)
self:diagnostic({
message = "Required by " .. table.concat(pp, ", "),
})
elseif vim.tbl_contains(LazyVim.plugin.core_imports, extra.module) then
self:diagnostic({
message = "This extra is included by default",
})
else
self:diagnostic({
message = "Not managed by LazyExtras (config)",
severity = vim.diagnostic.severity.WARN,
})
end
end
extra.row = self.text:row()
local hl = extra.managed and "LazySpecial" or "LazyLocal"

View file

@ -32,6 +32,11 @@ function M.register(picker)
if vim.v.vim_did_enter == 1 then
return true
end
if M.picker and M.picker.name ~= M.want() then
M.picker = nil
end
if M.picker and M.picker.name ~= picker.name then
LazyVim.warn(
"`LazyVim.pick`: picker already set to `" .. M.picker.name .. "`,\nignoring new picker `" .. picker.name .. "`"
@ -42,6 +47,14 @@ function M.register(picker)
return true
end
function M.want()
vim.g.lazyvim_picker = vim.g.lazyvim_picker or "auto"
if vim.g.lazyvim_picker == "auto" then
return LazyVim.has_extra("editor.fzf") and "fzf" or "telescope"
end
return vim.g.lazyvim_picker
end
---@param command? string
---@param opts? lazyvim.util.pick.Opts
function M.open(command, opts)

View file

@ -3,6 +3,9 @@ local Plugin = require("lazy.core.plugin")
---@class lazyvim.util.plugin
local M = {}
---@type string[]
M.core_imports = {}
M.lazy_file_events = { "BufReadPost", "BufNewFile", "BufWritePre" }
---@type table<string, string>
@ -32,6 +35,13 @@ M.renames = {
["glepnir/dashboard-nvim"] = "nvimdev/dashboard-nvim",
}
function M.save_core()
if vim.v.vim_did_enter == 1 then
return
end
M.core_imports = vim.deepcopy(require("lazy.core.config").spec.modules)
end
function M.setup()
M.fix_imports()
M.fix_renames()