mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
Merge branch 'main' of https://github.com/dbger/LazyVim
This commit is contained in:
commit
fb9ba3b725
25 changed files with 280 additions and 117 deletions
3
.github/.release-please-manifest.json
vendored
Normal file
3
.github/.release-please-manifest.json
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
".": "12.19.1"
|
||||
}
|
||||
9
.github/release-please-config.json
vendored
Normal file
9
.github/release-please-config.json
vendored
Normal 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"]
|
||||
}
|
||||
}
|
||||
}
|
||||
3
.github/workflows/ci.yml
vendored
3
.github/workflows/ci.yml
vendored
|
|
@ -67,7 +67,8 @@ jobs:
|
|||
- uses: googleapis/release-please-action@v4
|
||||
id: release
|
||||
with:
|
||||
release-type: simple
|
||||
config-file: .github/release-please-config.json
|
||||
manifest-file: .github/.release-please-manifest.json
|
||||
- uses: actions/checkout@v4
|
||||
- name: tag stable versions
|
||||
if: ${{ steps.release.outputs.release_created }}
|
||||
|
|
|
|||
62
CHANGELOG.md
62
CHANGELOG.md
|
|
@ -1,5 +1,67 @@
|
|||
# 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)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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*
|
||||
|
|
|
|||
|
|
@ -67,6 +67,7 @@ vim.api.nvim_create_autocmd("FileType", {
|
|||
"neotest-summary",
|
||||
"neotest-output-panel",
|
||||
"dbout",
|
||||
"gitsigns.blame",
|
||||
},
|
||||
callback = function(event)
|
||||
vim.bo[event.buf].buflisted = false
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util")
|
|||
---@class LazyVimConfig: LazyVimOptions
|
||||
local M = {}
|
||||
|
||||
M.version = "10.21.1" -- x-release-please-version
|
||||
M.version = "12.19.1" -- x-release-please-version
|
||||
LazyVim.config = M
|
||||
|
||||
---@class LazyVimOptions
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ return {
|
|||
})
|
||||
end,
|
||||
opts = {
|
||||
sources = { "filesystem", "buffers", "git_status", "document_symbols" },
|
||||
sources = { "filesystem", "buffers", "git_status" },
|
||||
open_files_do_not_replace_types = { "terminal", "Trouble", "trouble", "qf", "Outline" },
|
||||
filesystem = {
|
||||
bind_to_cwd = false,
|
||||
|
|
@ -177,7 +177,7 @@ return {
|
|||
["<leader>c"] = { name = "+code" },
|
||||
["<leader>f"] = { name = "+file/find" },
|
||||
["<leader>g"] = { name = "+git" },
|
||||
["<leader>gh"] = { name = "+hunks" },
|
||||
["<leader>gh"] = { name = "+hunks", ["_"] = "which_key_ignore" },
|
||||
["<leader>q"] = { name = "+quit/session" },
|
||||
["<leader>s"] = { name = "+search" },
|
||||
["<leader>u"] = { name = "+ui" },
|
||||
|
|
@ -215,8 +215,20 @@ return {
|
|||
end
|
||||
|
||||
-- stylua: ignore start
|
||||
map("n", "]h", function() gs.nav_hunk("next") end, "Next Hunk")
|
||||
map("n", "[h", function() gs.nav_hunk("prev") end, "Prev Hunk")
|
||||
map("n", "]h", function()
|
||||
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("first") end, "First 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>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() end, "Blame Buffer")
|
||||
map("n", "<leader>ghd", gs.diffthis, "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")
|
||||
|
|
|
|||
|
|
@ -49,7 +49,9 @@ return {
|
|||
|
||||
config = function()
|
||||
-- load mason-nvim-dap here, after all adapters have been setup
|
||||
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" })
|
||||
|
||||
|
|
|
|||
|
|
@ -131,7 +131,11 @@ return {
|
|||
-- 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,
|
||||
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",
|
||||
vertical = "down:15,border-top",
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
{
|
||||
"ThePrimeagen/refactoring.nvim",
|
||||
|
|
@ -10,9 +31,7 @@ return {
|
|||
{ "<leader>r", "", desc = "+refactor", mode = { "n", "v" } },
|
||||
{
|
||||
"<leader>rs",
|
||||
function()
|
||||
require("telescope").extensions.refactoring.refactors()
|
||||
end,
|
||||
pick,
|
||||
mode = "v",
|
||||
desc = "Refactor",
|
||||
},
|
||||
|
|
|
|||
|
|
@ -3,9 +3,11 @@ return {
|
|||
return LazyVim.extras.wants({
|
||||
ft = "astro",
|
||||
root = {
|
||||
-- https://docs.astro.build/en/guides/configuring-astro/#supported-config-file-types
|
||||
"astro.config.js",
|
||||
"astro.config.mjs",
|
||||
"astro.config.cjs",
|
||||
"astro.config.ts",
|
||||
},
|
||||
})
|
||||
end,
|
||||
|
|
|
|||
|
|
@ -14,10 +14,6 @@ return {
|
|||
opts = {
|
||||
servers = {
|
||||
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 = {
|
||||
gopls = {
|
||||
gofumpt = true,
|
||||
|
|
@ -129,14 +125,14 @@ return {
|
|||
"nvim-neotest/neotest",
|
||||
optional = true,
|
||||
dependencies = {
|
||||
"nvim-neotest/neotest-go",
|
||||
"fredrikaverpil/neotest-golang",
|
||||
},
|
||||
opts = {
|
||||
adapters = {
|
||||
["neotest-go"] = {
|
||||
-- Here we can set options for neotest-go, e.g.
|
||||
-- args = { "-tags=integration" }
|
||||
recursive_run = true,
|
||||
["neotest-golang"] = {
|
||||
-- Here we can set options for neotest-golang, e.g.
|
||||
-- go_test_args = { "-v", "-race", "-count=1", "-timeout=60s" },
|
||||
dap_go_enabled = true, -- requires leoluz/nvim-dap-go
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,7 +1,12 @@
|
|||
LazyVim.on_very_lazy(function()
|
||||
vim.filetype.add({
|
||||
extension = { mdx = "markdown.mdx" },
|
||||
})
|
||||
end)
|
||||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = "markdown",
|
||||
ft = { "markdown", "markdown.mdx" },
|
||||
root = "README.md",
|
||||
})
|
||||
end,
|
||||
|
|
|
|||
21
lua/lazyvim/plugins/extras/lang/prisma.lua
Normal file
21
lua/lazyvim/plugins/extras/lang/prisma.lua
Normal 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 = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -93,7 +93,7 @@ return {
|
|||
},
|
||||
config = function()
|
||||
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
|
||||
require("dap-python").setup(LazyVim.get_pkg_path("debugpy", "/venv/bin/python"))
|
||||
end
|
||||
|
|
|
|||
|
|
@ -10,10 +10,11 @@ return {
|
|||
-- or a table of adapter names, mapped to adapter configs.
|
||||
-- The adapter will then be automatically loaded with the config.
|
||||
adapters = {},
|
||||
-- Example for loading neotest-go with a custom config
|
||||
-- Example for loading neotest-golang with a custom config
|
||||
-- adapters = {
|
||||
-- ["neotest-go"] = {
|
||||
-- args = { "-tags=integration" },
|
||||
-- ["neotest-golang"] = {
|
||||
-- go_test_args = { "-v", "-race", "-count=1", "-timeout=60s" },
|
||||
-- dap_go_enabled = true,
|
||||
-- },
|
||||
-- },
|
||||
status = { virtual_text = true },
|
||||
|
|
|
|||
|
|
@ -77,43 +77,28 @@ return {
|
|||
}
|
||||
|
||||
if LazyVim.has("neo-tree.nvim") then
|
||||
table.insert(opts.left, 1, {
|
||||
title = "Neo-Tree",
|
||||
local pos = {
|
||||
filesystem = "left",
|
||||
buffers = "top",
|
||||
git_status = "right",
|
||||
document_symbols = "bottom",
|
||||
diagnostics = "bottom",
|
||||
}
|
||||
local sources = LazyVim.opts("neo-tree.nvim").sources or {}
|
||||
for i, v in ipairs(sources) do
|
||||
table.insert(opts.left, i, {
|
||||
title = "Neo-Tree " .. v:gsub("_", " "):gsub("^%l", string.upper),
|
||||
ft = "neo-tree",
|
||||
filter = function(buf)
|
||||
return vim.b[buf].neo_tree_source == "filesystem"
|
||||
return vim.b[buf].neo_tree_source == v
|
||||
end,
|
||||
pinned = true,
|
||||
open = function()
|
||||
require("neo-tree.command").execute({ dir = LazyVim.root() })
|
||||
vim.cmd(("Neotree show position=%s %s dir=%s"):format(pos[v] or "bottom", v, LazyVim.root()))
|
||||
end,
|
||||
size = { height = 0.5 },
|
||||
})
|
||||
-- only add neo-tree sources if they are enabled in config
|
||||
local neotree_opts = LazyVim.opts("neo-tree.nvim")
|
||||
local neotree_sources = { buffers = "top", git_status = "right" }
|
||||
|
||||
for source, pos in pairs(neotree_sources) do
|
||||
if vim.list_contains(neotree_opts.sources or {}, source) then
|
||||
table.insert(opts.left, {
|
||||
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
|
||||
table.insert(opts.left, {
|
||||
title = "Neo-Tree Other",
|
||||
ft = "neo-tree",
|
||||
filter = function(buf)
|
||||
return vim.b[buf].neo_tree_source ~= nil
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
for _, pos in ipairs({ "top", "bottom", "left", "right" }) do
|
||||
opts[pos] = opts[pos] or {}
|
||||
|
|
|
|||
|
|
@ -8,9 +8,6 @@ return {
|
|||
"pwntester/octo.nvim",
|
||||
cmd = "Octo",
|
||||
event = { { event = "BufReadCmd", pattern = "octo://*" } },
|
||||
init = function()
|
||||
vim.treesitter.language.register("markdown", "octo")
|
||||
end,
|
||||
opts = {
|
||||
enable_builtin = true,
|
||||
default_to_projects_v2 = true,
|
||||
|
|
@ -41,6 +38,7 @@ return {
|
|||
{
|
||||
"pwntester/octo.nvim",
|
||||
opts = function(_, opts)
|
||||
vim.treesitter.language.register("markdown", "octo")
|
||||
if LazyVim.has("telescope.nvim") then
|
||||
opts.picker = "telescope"
|
||||
elseif LazyVim.has("fzf-lua") then
|
||||
|
|
|
|||
|
|
@ -9,45 +9,71 @@ pick = function()
|
|||
local history = require("project_nvim.utils.history")
|
||||
local results = history.get_recent_projects()
|
||||
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, {
|
||||
actions = {
|
||||
["default"] = {
|
||||
function(selected)
|
||||
local function hl_validate(hl)
|
||||
return not utils.is_hl_cleared(hl) and hl or nil
|
||||
end
|
||||
|
||||
function actions.project_files(selected)
|
||||
fzf_lua.files({ cwd = selected[1] })
|
||||
end,
|
||||
},
|
||||
["ctrl-t"] = actions.file_tabedit,
|
||||
["ctrl-s"] = {
|
||||
function(selected)
|
||||
end
|
||||
|
||||
function actions.project_live_grep(selected)
|
||||
fzf_lua.live_grep({ cwd = selected[1] })
|
||||
end,
|
||||
},
|
||||
["ctrl-r"] = {
|
||||
function(selected)
|
||||
end
|
||||
|
||||
function actions.project_oldfiles(selected)
|
||||
fzf_lua.oldfiles({ cwd = selected[1] })
|
||||
end,
|
||||
},
|
||||
["ctrl-w"] = {
|
||||
function(selected)
|
||||
end
|
||||
|
||||
function actions.project_cd_cwd(selected)
|
||||
local path = selected[1]
|
||||
local ok = project.set_pwd(path)
|
||||
if ok then
|
||||
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<Esc>", true, false, true), "n", true)
|
||||
LazyVim.info("Change project dir to " .. path)
|
||||
end
|
||||
end,
|
||||
},
|
||||
["ctrl-d"] = function(selected)
|
||||
end
|
||||
|
||||
function actions.project_delete(selected)
|
||||
local path = selected[1]
|
||||
local choice = vim.fn.confirm("Delete '" .. path .. "' project? ", "&Yes\n&No")
|
||||
if choice == 1 then
|
||||
history.delete_project({ value = path })
|
||||
end
|
||||
pick()
|
||||
end,
|
||||
end
|
||||
|
||||
-- core.ACTION_DEFINITIONS[actions.project_files] = { "find project files" }
|
||||
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
|
||||
|
||||
|
|
|
|||
|
|
@ -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-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
|
||||
|
|
@ -348,13 +357,15 @@ return {
|
|||
button.key_format = " %s"
|
||||
end
|
||||
|
||||
-- close Lazy and re-open when the dashboard is ready
|
||||
-- open dashboard after closing lazy
|
||||
if vim.o.filetype == "lazy" then
|
||||
vim.cmd.close()
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "DashboardLoaded",
|
||||
vim.api.nvim_create_autocmd("WinClosed", {
|
||||
pattern = tostring(vim.api.nvim_get_current_win()),
|
||||
once = true,
|
||||
callback = function()
|
||||
require("lazy").show()
|
||||
vim.schedule(function()
|
||||
vim.api.nvim_exec_autocmds("UIEnter", { group = "dashboard" })
|
||||
end)
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
|
|
|||
|
|
@ -176,6 +176,10 @@ function M.browse()
|
|||
local function open(remote)
|
||||
if remote then
|
||||
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)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -30,12 +30,13 @@ function M.detectors.lsp(buf)
|
|||
end
|
||||
local roots = {} ---@type string[]
|
||||
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
|
||||
for _, ws in pairs(workspace or {}) do
|
||||
roots[#roots + 1] = vim.uri_to_fname(ws.uri)
|
||||
end
|
||||
if client.root_dir then
|
||||
roots[#roots + 1] = client.root_dir
|
||||
end
|
||||
end
|
||||
return vim.tbl_filter(function(path)
|
||||
path = LazyVim.norm(path)
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ function M.statuscolumn()
|
|||
elseif
|
||||
show_open_folds
|
||||
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
|
||||
fold = { text = vim.opt.fillchars:get().foldopen or "", texthl = githl }
|
||||
end
|
||||
|
|
@ -140,11 +140,15 @@ function M.statuscolumn()
|
|||
local is_num = vim.wo[win].number
|
||||
local is_relnum = vim.wo[win].relativenumber
|
||||
if (is_num or is_relnum) and vim.v.virtnum == 0 then
|
||||
if vim.fn.has("nvim-0.11") == 1 then
|
||||
components[2] = "%l" -- 0.11 handles both the current and other lines with %l
|
||||
else
|
||||
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
|
||||
components[2] = "%=" .. components[2] .. " " -- right align
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -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"]
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue