This commit is contained in:
dbger 2024-06-25 11:59:09 +08:00
commit fb9ba3b725
25 changed files with 280 additions and 117 deletions

3
.github/.release-please-manifest.json vendored Normal file
View file

@ -0,0 +1,3 @@
{
".": "12.19.1"
}

9
.github/release-please-config.json vendored Normal file
View file

@ -0,0 +1,9 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"packages": {
".": {
"release-type": "simple",
"extra-files": ["lua/lazyvim/config/init.lua"]
}
}
}

View file

@ -67,7 +67,8 @@ jobs:
- uses: googleapis/release-please-action@v4 - uses: googleapis/release-please-action@v4
id: release id: release
with: with:
release-type: simple config-file: .github/release-please-config.json
manifest-file: .github/.release-please-manifest.json
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: tag stable versions - name: tag stable versions
if: ${{ steps.release.outputs.release_created }} if: ${{ steps.release.outputs.release_created }}

View file

@ -1,5 +1,67 @@
# Changelog # Changelog
## [12.19.1](https://github.com/LazyVim/LazyVim/compare/v12.19.0...v12.19.1) (2024-06-23)
### Bug Fixes
* **dap:** only load `mason-nvim-dap` when not disabled ([#3784](https://github.com/LazyVim/LazyVim/issues/3784)) ([b55c773](https://github.com/LazyVim/LazyVim/commit/b55c7734df72ff06659c16f5f9ed27b6b7199d44))
* **extras.astro:** support `astro.config.ts` root ([#3786](https://github.com/LazyVim/LazyVim/issues/3786)) ([8be66bb](https://github.com/LazyVim/LazyVim/commit/8be66bb1a62aae97552032926fdcc101867b2028))
* **lazygit:** use `lazy.util.open` on Neovim <= 0.10 ([#3778](https://github.com/LazyVim/LazyVim/issues/3778)) ([8ea3f69](https://github.com/LazyVim/LazyVim/commit/8ea3f690e6017ba37022060a62f1d69fbf3aeaf7))
* **markdown:** added support for mdx files ([abec8fb](https://github.com/LazyVim/LazyVim/commit/abec8fbb03bdbe881c35401274083f315025a1ed))
## [12.19.0](https://github.com/LazyVim/LazyVim/compare/v12.18.0...v12.19.0) (2024-06-23)
### Features
* **gitsigns:** navigate diff changes as well as git hunks with [h/]h ([#3736](https://github.com/LazyVim/LazyVim/issues/3736)) ([1f42393](https://github.com/LazyVim/LazyVim/commit/1f423930e03078eb1a2786356a46287c8a466c91))
* **gitsigns:** new keymap for `Gitsigns blame` ([#3758](https://github.com/LazyVim/LazyVim/issues/3758)) ([b22831b](https://github.com/LazyVim/LazyVim/commit/b22831b7e25a4681df171da30204d4d4f7e9abfa))
* **go:** switch to neotest-golang ([#3749](https://github.com/LazyVim/LazyVim/issues/3749)) ([55464b7](https://github.com/LazyVim/LazyVim/commit/55464b77c6ae8f14306ce743bcb3c5c465af3d4f))
### Bug Fixes
* **neo-tree:** don't enable document symbols by default ([52d4616](https://github.com/LazyVim/LazyVim/commit/52d46166b14a9e99509c509482d9a0979fa00809))
* **refactoring:** use `pick` for both Telescope and fzf-lua ([#3769](https://github.com/LazyVim/LazyVim/issues/3769)) ([b45d4ed](https://github.com/LazyVim/LazyVim/commit/b45d4ed62c613a4c47dd9183cf51985f2b153b21))
* **statuscolumn:** fix `folds_open = true` ([#3756](https://github.com/LazyVim/LazyVim/issues/3756)) ([b47c65f](https://github.com/LazyVim/LazyVim/commit/b47c65f4087c4d82720ab7439f395aba5d6b5f40))
## [12.18.0](https://github.com/LazyVim/LazyVim/compare/v12.17.0...v12.18.0) (2024-06-19)
### Features
* **extra:** add prisma support and config ([#3684](https://github.com/LazyVim/LazyVim/issues/3684)) ([1101c3e](https://github.com/LazyVim/LazyVim/commit/1101c3ed24709feec85371a951ea0feed6bd50fa))
* **project:** add fzf-lua keymap descriptions ([#3690](https://github.com/LazyVim/LazyVim/issues/3690)) ([07ab681](https://github.com/LazyVim/LazyVim/commit/07ab681b1d6f0223e6b265f3eb6aaafbd12e5c0e))
### Bug Fixes
* **dap:** get the correct debugpy pkg path on windows ([#3716](https://github.com/LazyVim/LazyVim/issues/3716)) ([06f13da](https://github.com/LazyVim/LazyVim/commit/06f13daf7261377ecfa6b4ac845d742f446df719))
* **extras.python:** avoid launching extra console with dap on Windows ([#3723](https://github.com/LazyVim/LazyVim/issues/3723)) ([67eece6](https://github.com/LazyVim/LazyVim/commit/67eece6d74f071035ca7b934a753d71d1677dd9b))
* **root:** also check root_dir. Fixes [#3732](https://github.com/LazyVim/LazyVim/issues/3732) ([d4991d5](https://github.com/LazyVim/LazyVim/commit/d4991d5aac3c4ab5865e65d73fb8957b3d61bdc3))
* **statuscolumn:** `%r` deprecated in nightly and `%l` handles everything ([#3719](https://github.com/LazyVim/LazyVim/issues/3719)) ([1a295c5](https://github.com/LazyVim/LazyVim/commit/1a295c5ef8cab02c6054067c35ca805a3e4ccf72))
## [12.17.0](https://github.com/LazyVim/LazyVim/compare/v12.16.0...v12.17.0) (2024-06-18)
### Features
* **copilot-chat:** ctrl-s now works in both normal and insert mode ([0fcadce](https://github.com/LazyVim/LazyVim/commit/0fcadced89f96f59a9f9cb0c85ee73990df1219f))
* **php:** allow using intelephense instead of phpactor in php extras ([#3691](https://github.com/LazyVim/LazyVim/issues/3691)) ([ea3b5cc](https://github.com/LazyVim/LazyVim/commit/ea3b5cc2ab4ff7d70163ab66ea7fa0acc0e88566))
* **treesitter-textobjects:** added ]a and [a to move between parameters ([18c7731](https://github.com/LazyVim/LazyVim/commit/18c7731281f7a9886ae98d9c034661fa85340fb2))
### Bug Fixes
* **cmp:** visible ([57ef349](https://github.com/LazyVim/LazyVim/commit/57ef349910ec40c7024f3b50a549aabefa1ebbf0))
* **conform:** `lsp_format` breaking changes ([#3707](https://github.com/LazyVim/LazyVim/issues/3707)) ([a69e626](https://github.com/LazyVim/LazyVim/commit/a69e626d7a3a027df124bae7b2672658a4fb5b0f))
* **edgy:** only enable edgy neo-tree when needed. Fixes [#3697](https://github.com/LazyVim/LazyVim/issues/3697). Closes [#3703](https://github.com/LazyVim/LazyVim/issues/3703) ([bdca1e9](https://github.com/LazyVim/LazyVim/commit/bdca1e95ff97348501a715bd6aa5977422a27969))
* **git:** removed debug info ([d9caee6](https://github.com/LazyVim/LazyVim/commit/d9caee610038548a4b79f2b6eb126180ec8ba6b6))
* **lazygit:** support monorepo structure and other git providers ([#3701](https://github.com/LazyVim/LazyVim/issues/3701)) ([1f034e1](https://github.com/LazyVim/LazyVim/commit/1f034e16000692d1d0ec8e02110d37cf2089bd4c))
* **lsp:** dont highlight document words when cmp is visible ([0d57115](https://github.com/LazyVim/LazyVim/commit/0d57115f01b4094f68e426942e14892f204ec664))
* **snippets:** nvim-snippets `<S-Tab>` prev key ([#3712](https://github.com/LazyVim/LazyVim/issues/3712)) ([492fa86](https://github.com/LazyVim/LazyVim/commit/492fa86faa29f2987f662ad0cdb796b5c1c49ef3))
## [12.16.0](https://github.com/LazyVim/LazyVim/compare/v12.15.0...v12.16.0) (2024-06-16) ## [12.16.0](https://github.com/LazyVim/LazyVim/compare/v12.15.0...v12.16.0) (2024-06-16)

View file

@ -1,4 +1,4 @@
*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 18 *LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 23
============================================================================== ==============================================================================
Table of Contents *LazyVim-table-of-contents* Table of Contents *LazyVim-table-of-contents*

View file

@ -67,6 +67,7 @@ vim.api.nvim_create_autocmd("FileType", {
"neotest-summary", "neotest-summary",
"neotest-output-panel", "neotest-output-panel",
"dbout", "dbout",
"gitsigns.blame",
}, },
callback = function(event) callback = function(event)
vim.bo[event.buf].buflisted = false vim.bo[event.buf].buflisted = false

View file

@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util")
---@class LazyVimConfig: LazyVimOptions ---@class LazyVimConfig: LazyVimOptions
local M = {} local M = {}
M.version = "10.21.1" -- x-release-please-version M.version = "12.19.1" -- x-release-please-version
LazyVim.config = M LazyVim.config = M
---@class LazyVimOptions ---@class LazyVimOptions

View file

@ -60,7 +60,7 @@ return {
}) })
end, end,
opts = { opts = {
sources = { "filesystem", "buffers", "git_status", "document_symbols" }, sources = { "filesystem", "buffers", "git_status" },
open_files_do_not_replace_types = { "terminal", "Trouble", "trouble", "qf", "Outline" }, open_files_do_not_replace_types = { "terminal", "Trouble", "trouble", "qf", "Outline" },
filesystem = { filesystem = {
bind_to_cwd = false, bind_to_cwd = false,
@ -177,7 +177,7 @@ return {
["<leader>c"] = { name = "+code" }, ["<leader>c"] = { name = "+code" },
["<leader>f"] = { name = "+file/find" }, ["<leader>f"] = { name = "+file/find" },
["<leader>g"] = { name = "+git" }, ["<leader>g"] = { name = "+git" },
["<leader>gh"] = { name = "+hunks" }, ["<leader>gh"] = { name = "+hunks", ["_"] = "which_key_ignore" },
["<leader>q"] = { name = "+quit/session" }, ["<leader>q"] = { name = "+quit/session" },
["<leader>s"] = { name = "+search" }, ["<leader>s"] = { name = "+search" },
["<leader>u"] = { name = "+ui" }, ["<leader>u"] = { name = "+ui" },
@ -215,8 +215,20 @@ return {
end end
-- stylua: ignore start -- stylua: ignore start
map("n", "]h", function() gs.nav_hunk("next") end, "Next Hunk") map("n", "]h", function()
map("n", "[h", function() gs.nav_hunk("prev") end, "Prev Hunk") if vim.wo.diff then
vim.cmd.normal({ "]c", bang = true })
else
gs.nav_hunk("next")
end
end, "Next Hunk")
map("n", "[h", function()
if vim.wo.diff then
vim.cmd.normal({ "[c", bang = true })
else
gs.nav_hunk("prev")
end
end, "Prev Hunk")
map("n", "]H", function() gs.nav_hunk("last") end, "Last Hunk") map("n", "]H", function() gs.nav_hunk("last") end, "Last Hunk")
map("n", "[H", function() gs.nav_hunk("first") end, "First Hunk") map("n", "[H", function() gs.nav_hunk("first") end, "First Hunk")
map({ "n", "v" }, "<leader>ghs", ":Gitsigns stage_hunk<CR>", "Stage Hunk") map({ "n", "v" }, "<leader>ghs", ":Gitsigns stage_hunk<CR>", "Stage Hunk")
@ -226,6 +238,7 @@ return {
map("n", "<leader>ghR", gs.reset_buffer, "Reset Buffer") map("n", "<leader>ghR", gs.reset_buffer, "Reset Buffer")
map("n", "<leader>ghp", gs.preview_hunk_inline, "Preview Hunk Inline") map("n", "<leader>ghp", gs.preview_hunk_inline, "Preview Hunk Inline")
map("n", "<leader>ghb", function() gs.blame_line({ full = true }) end, "Blame Line") map("n", "<leader>ghb", function() gs.blame_line({ full = true }) end, "Blame Line")
map("n", "<leader>ghB", function() gs.blame() end, "Blame Buffer")
map("n", "<leader>ghd", gs.diffthis, "Diff This") map("n", "<leader>ghd", gs.diffthis, "Diff This")
map("n", "<leader>ghD", function() gs.diffthis("~") end, "Diff This ~") map("n", "<leader>ghD", function() gs.diffthis("~") end, "Diff This ~")
map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>", "GitSigns Select Hunk") map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>", "GitSigns Select Hunk")

View file

@ -49,7 +49,9 @@ return {
config = function() config = function()
-- load mason-nvim-dap here, after all adapters have been setup -- load mason-nvim-dap here, after all adapters have been setup
require("mason-nvim-dap").setup(LazyVim.opts("mason-nvim-dap.nvim")) if LazyVim.has("mason-nvim-dap.nvim") then
require("mason-nvim-dap").setup(LazyVim.opts("mason-nvim-dap.nvim"))
end
vim.api.nvim_set_hl(0, "DapStoppedLine", { default = true, link = "Visual" }) vim.api.nvim_set_hl(0, "DapStoppedLine", { default = true, link = "Visual" })

View file

@ -131,7 +131,11 @@ return {
-- height is number of items minus 15 lines for the preview, with a max of 80% screen height -- height is number of items minus 15 lines for the preview, with a max of 80% screen height
height = math.floor(math.min(vim.o.lines * 0.8 - 16, #items + 2) + 0.5) + 16, height = math.floor(math.min(vim.o.lines * 0.8 - 16, #items + 2) + 0.5) + 16,
width = 0.5, width = 0.5,
preview = { preview = not vim.tbl_isempty(LazyVim.lsp.get_clients({ bufnr = 0, name = "vtsls" })) and {
layout = "vertical",
vertical = "down:15,border-top",
hidden = "hidden",
} or {
layout = "vertical", layout = "vertical",
vertical = "down:15,border-top", vertical = "down:15,border-top",
}, },

View file

@ -1,3 +1,24 @@
local pick = function()
if LazyVim.pick.picker.name == "telescope" then
return require("telescope").extensions.refactoring.refactors()
elseif LazyVim.pick.picker.name == "fzf" then
local fzf_lua = require("fzf-lua")
local results = require("refactoring").get_refactors()
local refactoring = require("refactoring")
local opts = {
fzf_opts = {},
fzf_colors = true,
actions = {
["default"] = function(selected)
refactoring.refactor(selected[1])
end,
},
}
fzf_lua.fzf_exec(results, opts)
end
end
return { return {
{ {
"ThePrimeagen/refactoring.nvim", "ThePrimeagen/refactoring.nvim",
@ -10,9 +31,7 @@ return {
{ "<leader>r", "", desc = "+refactor", mode = { "n", "v" } }, { "<leader>r", "", desc = "+refactor", mode = { "n", "v" } },
{ {
"<leader>rs", "<leader>rs",
function() pick,
require("telescope").extensions.refactoring.refactors()
end,
mode = "v", mode = "v",
desc = "Refactor", desc = "Refactor",
}, },

View file

@ -3,9 +3,11 @@ return {
return LazyVim.extras.wants({ return LazyVim.extras.wants({
ft = "astro", ft = "astro",
root = { root = {
-- https://docs.astro.build/en/guides/configuring-astro/#supported-config-file-types
"astro.config.js", "astro.config.js",
"astro.config.mjs", "astro.config.mjs",
"astro.config.cjs", "astro.config.cjs",
"astro.config.ts",
}, },
}) })
end, end,

View file

@ -14,10 +14,6 @@ return {
opts = { opts = {
servers = { servers = {
gopls = { gopls = {
keys = {
-- Workaround for the lack of a DAP strategy in neotest-go: https://github.com/nvim-neotest/neotest-go/issues/12
{ "<leader>td", "<cmd>lua require('dap-go').debug_test()<CR>", desc = "Debug Nearest (Go)" },
},
settings = { settings = {
gopls = { gopls = {
gofumpt = true, gofumpt = true,
@ -129,14 +125,14 @@ return {
"nvim-neotest/neotest", "nvim-neotest/neotest",
optional = true, optional = true,
dependencies = { dependencies = {
"nvim-neotest/neotest-go", "fredrikaverpil/neotest-golang",
}, },
opts = { opts = {
adapters = { adapters = {
["neotest-go"] = { ["neotest-golang"] = {
-- Here we can set options for neotest-go, e.g. -- Here we can set options for neotest-golang, e.g.
-- args = { "-tags=integration" } -- go_test_args = { "-v", "-race", "-count=1", "-timeout=60s" },
recursive_run = true, dap_go_enabled = true, -- requires leoluz/nvim-dap-go
}, },
}, },
}, },

View file

@ -1,7 +1,12 @@
LazyVim.on_very_lazy(function()
vim.filetype.add({
extension = { mdx = "markdown.mdx" },
})
end)
return { return {
recommended = function() recommended = function()
return LazyVim.extras.wants({ return LazyVim.extras.wants({
ft = "markdown", ft = { "markdown", "markdown.mdx" },
root = "README.md", root = "README.md",
}) })
end, end,

View file

@ -0,0 +1,21 @@
return {
recommended = function()
return LazyVim.extras.wants({
ft = "prisma",
})
end,
{
"nvim-treesitter/nvim-treesitter",
opts = {
ensure_installed = { "prisma" },
},
},
{
"neovim/nvim-lspconfig",
opts = {
servers = {
prismals = {},
},
},
},
}

View file

@ -93,7 +93,7 @@ return {
}, },
config = function() config = function()
if vim.fn.has("win32") == 1 then if vim.fn.has("win32") == 1 then
require("dap-python").setup(LazyVim.get_pkg_path("debugpy", "/venv/Scripts/python.exe")) require("dap-python").setup(LazyVim.get_pkg_path("debugpy", "/venv/Scripts/pythonw.exe"))
else else
require("dap-python").setup(LazyVim.get_pkg_path("debugpy", "/venv/bin/python")) require("dap-python").setup(LazyVim.get_pkg_path("debugpy", "/venv/bin/python"))
end end

View file

@ -10,10 +10,11 @@ return {
-- or a table of adapter names, mapped to adapter configs. -- or a table of adapter names, mapped to adapter configs.
-- The adapter will then be automatically loaded with the config. -- The adapter will then be automatically loaded with the config.
adapters = {}, adapters = {},
-- Example for loading neotest-go with a custom config -- Example for loading neotest-golang with a custom config
-- adapters = { -- adapters = {
-- ["neotest-go"] = { -- ["neotest-golang"] = {
-- args = { "-tags=integration" }, -- go_test_args = { "-v", "-race", "-count=1", "-timeout=60s" },
-- dap_go_enabled = true,
-- }, -- },
-- }, -- },
status = { virtual_text = true }, status = { virtual_text = true },

View file

@ -77,42 +77,27 @@ return {
} }
if LazyVim.has("neo-tree.nvim") then if LazyVim.has("neo-tree.nvim") then
table.insert(opts.left, 1, { local pos = {
title = "Neo-Tree", filesystem = "left",
ft = "neo-tree", buffers = "top",
filter = function(buf) git_status = "right",
return vim.b[buf].neo_tree_source == "filesystem" document_symbols = "bottom",
end, diagnostics = "bottom",
pinned = true, }
open = function() local sources = LazyVim.opts("neo-tree.nvim").sources or {}
require("neo-tree.command").execute({ dir = LazyVim.root() }) for i, v in ipairs(sources) do
end, table.insert(opts.left, i, {
size = { height = 0.5 }, title = "Neo-Tree " .. v:gsub("_", " "):gsub("^%l", string.upper),
}) ft = "neo-tree",
-- only add neo-tree sources if they are enabled in config filter = function(buf)
local neotree_opts = LazyVim.opts("neo-tree.nvim") return vim.b[buf].neo_tree_source == v
local neotree_sources = { buffers = "top", git_status = "right" } end,
pinned = true,
for source, pos in pairs(neotree_sources) do open = function()
if vim.list_contains(neotree_opts.sources or {}, source) then vim.cmd(("Neotree show position=%s %s dir=%s"):format(pos[v] or "bottom", v, LazyVim.root()))
table.insert(opts.left, { end,
title = "Neo-Tree " .. source:gsub("_", " "), })
ft = "neo-tree",
filter = function(buf)
return vim.b[buf].neo_tree_source == source
end,
pinned = true,
open = "Neotree position=" .. pos .. " " .. source,
})
end
end end
table.insert(opts.left, {
title = "Neo-Tree Other",
ft = "neo-tree",
filter = function(buf)
return vim.b[buf].neo_tree_source ~= nil
end,
})
end end
for _, pos in ipairs({ "top", "bottom", "left", "right" }) do for _, pos in ipairs({ "top", "bottom", "left", "right" }) do

View file

@ -8,9 +8,6 @@ return {
"pwntester/octo.nvim", "pwntester/octo.nvim",
cmd = "Octo", cmd = "Octo",
event = { { event = "BufReadCmd", pattern = "octo://*" } }, event = { { event = "BufReadCmd", pattern = "octo://*" } },
init = function()
vim.treesitter.language.register("markdown", "octo")
end,
opts = { opts = {
enable_builtin = true, enable_builtin = true,
default_to_projects_v2 = true, default_to_projects_v2 = true,
@ -41,6 +38,7 @@ return {
{ {
"pwntester/octo.nvim", "pwntester/octo.nvim",
opts = function(_, opts) opts = function(_, opts)
vim.treesitter.language.register("markdown", "octo")
if LazyVim.has("telescope.nvim") then if LazyVim.has("telescope.nvim") then
opts.picker = "telescope" opts.picker = "telescope"
elseif LazyVim.has("fzf-lua") then elseif LazyVim.has("fzf-lua") then

View file

@ -9,45 +9,71 @@ pick = function()
local history = require("project_nvim.utils.history") local history = require("project_nvim.utils.history")
local results = history.get_recent_projects() local results = history.get_recent_projects()
local actions = require("fzf-lua.actions") local actions = require("fzf-lua.actions")
local core = require("fzf-lua.core")
-- local path = require("fzf-lua.path")
local utils = require("fzf-lua.utils")
fzf_lua.fzf_exec(results, { local function hl_validate(hl)
actions = { return not utils.is_hl_cleared(hl) and hl or nil
["default"] = { end
function(selected)
fzf_lua.files({ cwd = selected[1] }) function actions.project_files(selected)
end, fzf_lua.files({ cwd = selected[1] })
}, end
["ctrl-t"] = actions.file_tabedit,
["ctrl-s"] = { function actions.project_live_grep(selected)
function(selected) fzf_lua.live_grep({ cwd = selected[1] })
fzf_lua.live_grep({ cwd = selected[1] }) end
end,
}, function actions.project_oldfiles(selected)
["ctrl-r"] = { fzf_lua.oldfiles({ cwd = selected[1] })
function(selected) end
fzf_lua.oldfiles({ cwd = selected[1] })
end, function actions.project_cd_cwd(selected)
}, local path = selected[1]
["ctrl-w"] = { local ok = project.set_pwd(path)
function(selected) if ok then
local path = selected[1] vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<Esc>", true, false, true), "n", true)
local ok = project.set_pwd(path) LazyVim.info("Change project dir to " .. path)
if ok then end
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<Esc>", true, false, true), "n", true) end
LazyVim.info("Change project dir to " .. path)
end function actions.project_delete(selected)
end, local path = selected[1]
}, local choice = vim.fn.confirm("Delete '" .. path .. "' project? ", "&Yes\n&No")
["ctrl-d"] = function(selected) if choice == 1 then
local path = selected[1] history.delete_project({ value = path })
local choice = vim.fn.confirm("Delete '" .. path .. "' project? ", "&Yes\n&No") end
if choice == 1 then pick()
history.delete_project({ value = path }) end
end
pick() -- core.ACTION_DEFINITIONS[actions.project_files] = { "find project files" }
end, core.ACTION_DEFINITIONS[actions.file_tabedit] = { "tabedit" }
core.ACTION_DEFINITIONS[actions.project_live_grep] = { "live_grep" }
core.ACTION_DEFINITIONS[actions.project_oldfiles] = { "oldfiles" }
core.ACTION_DEFINITIONS[actions.project_cd_cwd] = { "change dir" }
core.ACTION_DEFINITIONS[actions.project_delete] = { "delete" }
local opts = {
fzf_opts = {},
hls = {
header_bind = hl_validate("FzfLuaHeaderBind"),
header_text = hl_validate("FzfLuaHeaderText"),
}, },
}) fzf_colors = true,
header_separator = " | ",
actions = {
["default"] = actions.project_files,
["ctrl-t"] = actions.file_tabedit,
["ctrl-s"] = actions.project_live_grep,
["ctrl-r"] = actions.project_oldfiles,
["ctrl-w"] = actions.project_cd_cwd,
["ctrl-d"] = actions.project_delete,
},
}
opts = core.set_header(opts, { "actions" })
fzf_lua.fzf_exec(results, opts)
end end
end end

View file

@ -291,6 +291,15 @@ return {
{ "<c-f>", function() if not require("noice.lsp").scroll(4) then return "<c-f>" end end, silent = true, expr = true, desc = "Scroll Forward", mode = {"i", "n", "s"} }, { "<c-f>", function() if not require("noice.lsp").scroll(4) then return "<c-f>" end end, silent = true, expr = true, desc = "Scroll Forward", mode = {"i", "n", "s"} },
{ "<c-b>", function() if not require("noice.lsp").scroll(-4) then return "<c-b>" end end, silent = true, expr = true, desc = "Scroll Backward", mode = {"i", "n", "s"}}, { "<c-b>", function() if not require("noice.lsp").scroll(-4) then return "<c-b>" end end, silent = true, expr = true, desc = "Scroll Backward", mode = {"i", "n", "s"}},
}, },
config = function(_, opts)
-- HACK: noice shows messages from before it was enabled,
-- but this is not ideal when Lazy is installing plugins,
-- so clear the messages in this case.
if vim.o.filetype == "lazy" then
vim.cmd([[messages clear]])
end
require("noice").setup(opts)
end,
}, },
-- icons -- icons
@ -348,13 +357,15 @@ return {
button.key_format = " %s" button.key_format = " %s"
end end
-- close Lazy and re-open when the dashboard is ready -- open dashboard after closing lazy
if vim.o.filetype == "lazy" then if vim.o.filetype == "lazy" then
vim.cmd.close() vim.api.nvim_create_autocmd("WinClosed", {
vim.api.nvim_create_autocmd("User", { pattern = tostring(vim.api.nvim_get_current_win()),
pattern = "DashboardLoaded", once = true,
callback = function() callback = function()
require("lazy").show() vim.schedule(function()
vim.api.nvim_exec_autocmds("UIEnter", { group = "dashboard" })
end)
end, end,
}) })
end end

View file

@ -176,6 +176,10 @@ function M.browse()
local function open(remote) local function open(remote)
if remote then if remote then
LazyVim.info(("Opening [%s](%s)"):format(remote.name, remote.url)) LazyVim.info(("Opening [%s](%s)"):format(remote.name, remote.url))
if vim.fn.has("nvim-0.10") == 0 then
require("lazy.util").open(remote.url, { system = true })
return
end
vim.ui.open(remote.url) vim.ui.open(remote.url)
end end
end end

View file

@ -30,12 +30,13 @@ function M.detectors.lsp(buf)
end end
local roots = {} ---@type string[] local roots = {} ---@type string[]
for _, client in pairs(LazyVim.lsp.get_clients({ bufnr = buf })) do for _, client in pairs(LazyVim.lsp.get_clients({ bufnr = buf })) do
-- only check workspace folders, since we're not interested in clients
-- running in single file mode
local workspace = client.config.workspace_folders local workspace = client.config.workspace_folders
for _, ws in pairs(workspace or {}) do for _, ws in pairs(workspace or {}) do
roots[#roots + 1] = vim.uri_to_fname(ws.uri) roots[#roots + 1] = vim.uri_to_fname(ws.uri)
end end
if client.root_dir then
roots[#roots + 1] = client.root_dir
end
end end
return vim.tbl_filter(function(path) return vim.tbl_filter(function(path)
path = LazyVim.norm(path) path = LazyVim.norm(path)

View file

@ -124,7 +124,7 @@ function M.statuscolumn()
elseif elseif
show_open_folds show_open_folds
and not LazyVim.ui.skip_foldexpr[buf] and not LazyVim.ui.skip_foldexpr[buf]
and vim.treesitter.foldexpr(vim.v.lnum):sub(1, 1) == ">" and tostring(vim.treesitter.foldexpr(vim.v.lnum)):sub(1, 1) == ">"
then -- fold start then -- fold start
fold = { text = vim.opt.fillchars:get().foldopen or "", texthl = githl } fold = { text = vim.opt.fillchars:get().foldopen or "", texthl = githl }
end end
@ -140,10 +140,14 @@ function M.statuscolumn()
local is_num = vim.wo[win].number local is_num = vim.wo[win].number
local is_relnum = vim.wo[win].relativenumber local is_relnum = vim.wo[win].relativenumber
if (is_num or is_relnum) and vim.v.virtnum == 0 then if (is_num or is_relnum) and vim.v.virtnum == 0 then
if vim.v.relnum == 0 then if vim.fn.has("nvim-0.11") == 1 then
components[2] = is_num and "%l" or "%r" -- the current line components[2] = "%l" -- 0.11 handles both the current and other lines with %l
else else
components[2] = is_relnum and "%r" or "%l" -- other lines if vim.v.relnum == 0 then
components[2] = is_num and "%l" or "%r" -- the current line
else
components[2] = is_relnum and "%r" or "%l" -- other lines
end
end end
components[2] = "%=" .. components[2] .. " " -- right align components[2] = "%=" .. components[2] .. " " -- right align
end end

View file

@ -1,5 +0,0 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"release-type": "simple",
"extra-files": ["lua/lazyvim/config/init.lua"]
}