From 43afed121195df6591d0e941b913b98f849c8af3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90=20-=20DEV?= Date: Tue, 11 Jun 2024 01:15:27 +0700 Subject: [PATCH 001/323] fix(extras.copilot-chat): small ui fix for which-key in visual mode (#3573) ## What is this PR for? - Just a small fix for which-key in visual mode that the authors forgot to add. ## Does this PR fix an existing issue? - As copilot-chat has just been added to extras so i think this is new. ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/coding/copilot-chat.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/coding/copilot-chat.lua b/lua/lazyvim/plugins/extras/coding/copilot-chat.lua index c21c51d6..59f5bded 100644 --- a/lua/lazyvim/plugins/extras/coding/copilot-chat.lua +++ b/lua/lazyvim/plugins/extras/coding/copilot-chat.lua @@ -22,7 +22,7 @@ return { } end, keys = { - { "a", "", desc = "+ai" }, + { "a", "", desc = "+ai", mode = { "n", "v" } }, { "aa", function() From caaa6c440d5c3b80c03cad1dfd93989b852bb875 Mon Sep 17 00:00:00 2001 From: Aleksey Imuzov Date: Mon, 10 Jun 2024 23:41:45 +0400 Subject: [PATCH 002/323] fix(neo-tree): use last window for preview (#3560) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Similar to "trouble.nvim" I want the preview to open in the last active window. Currently the neo-tree preview opens in a floating window, which (to me) doesn’t look very good. What do you think about doing preview window the same everywhere (trouble & neo-tree)? ## Before: https://github.com/LazyVim/LazyVim/assets/3313023/7d7c21c9-158d-40ef-82f2-62e0dc795555 ## After: https://github.com/LazyVim/LazyVim/assets/3313023/bafc5bae-20cb-4dd1-8e40-1358ada573d9 --------- Co-authored-by: github-actions[bot] --- lua/lazyvim/plugins/editor.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 8f4891b7..0e01da81 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -89,6 +89,7 @@ return { end, desc = "Open with System Application", }, + ["P"] = { "toggle_preview", config = { use_float = false } }, }, }, default_component_configs = { From 6ab404134db6004aab13dcf956e200ff063b2d42 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 10 Jun 2024 21:58:33 +0200 Subject: [PATCH 003/323] feat(extras): added fzf-lua (#3555) New extra with an initial implementation of fzf-lua. ## Todo - [x] check all places that currently depend on telescope and provide an alternative or disable - [x] disable telescope spec completely. (currently only removed its keymaps) - [x] trouble integration - [x] https://github.com/ibhagwan/fzf-lua/issues/1241 --------- Co-authored-by: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> --- lua/lazyvim/plugins/editor.lua | 30 ++-- lua/lazyvim/plugins/extras/editor/fzf.lua | 195 ++++++++++++++++++++++ lua/lazyvim/plugins/ui.lua | 8 +- lua/lazyvim/util/init.lua | 2 + lua/lazyvim/util/pick.lua | 72 ++++++++ lua/lazyvim/util/root.lua | 7 +- lua/lazyvim/util/telescope.lua | 71 ++++---- 7 files changed, 320 insertions(+), 65 deletions(-) create mode 100644 lua/lazyvim/plugins/extras/editor/fzf.lua create mode 100644 lua/lazyvim/util/pick.lua diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 0e01da81..d4a1c7fb 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -180,17 +180,17 @@ return { "Telescope buffers sort_mru=true sort_lastused=true", desc = "Switch Buffer", }, - { "/", LazyVim.telescope("live_grep"), desc = "Grep (Root Dir)" }, + { "/", LazyVim.pick("live_grep"), desc = "Grep (Root Dir)" }, { ":", "Telescope command_history", desc = "Command History" }, - { "", LazyVim.telescope("files"), desc = "Find Files (Root Dir)" }, + { "", LazyVim.pick("auto"), desc = "Find Files (Root Dir)" }, -- find { "fb", "Telescope buffers sort_mru=true sort_lastused=true", desc = "Buffers" }, - { "fc", LazyVim.telescope.config_files(), desc = "Find Config File" }, - { "ff", LazyVim.telescope("files"), desc = "Find Files (Root Dir)" }, - { "fF", LazyVim.telescope("files", { cwd = false }), desc = "Find Files (cwd)" }, + { "fc", LazyVim.pick.config_files(), desc = "Find Config File" }, + { "ff", LazyVim.pick("auto"), desc = "Find Files (Root Dir)" }, + { "fF", LazyVim.pick("auto", { root = false }), desc = "Find Files (cwd)" }, { "fg", "Telescope git_files", desc = "Find Files (git-files)" }, { "fr", "Telescope oldfiles", desc = "Recent" }, - { "fR", LazyVim.telescope("oldfiles", { cwd = vim.uv.cwd() }), desc = "Recent (cwd)" }, + { "fR", LazyVim.pick("oldfiles"), desc = "Recent (cwd)" }, -- git { "gc", "Telescope git_commits", desc = "Commits" }, { "gs", "Telescope git_status", desc = "Status" }, @@ -202,8 +202,8 @@ return { { "sC", "Telescope commands", desc = "Commands" }, { "sd", "Telescope diagnostics bufnr=0", desc = "Document Diagnostics" }, { "sD", "Telescope diagnostics", desc = "Workspace Diagnostics" }, - { "sg", LazyVim.telescope("live_grep"), desc = "Grep (Root Dir)" }, - { "sG", LazyVim.telescope("live_grep", { cwd = false }), desc = "Grep (cwd)" }, + { "sg", LazyVim.pick("live_grep"), desc = "Grep (Root Dir)" }, + { "sG", LazyVim.pick("live_grep", { root = false }), desc = "Grep (cwd)" }, { "sh", "Telescope help_tags", desc = "Help Pages" }, { "sH", "Telescope highlights", desc = "Search Highlight Groups" }, { "sj", "Telescope jumplist", desc = "Jumplist" }, @@ -214,11 +214,11 @@ return { { "so", "Telescope vim_options", desc = "Options" }, { "sR", "Telescope resume", desc = "Resume" }, { "sq", "Telescope quickfix", desc = "Quickfix List" }, - { "sw", LazyVim.telescope("grep_string", { word_match = "-w" }), desc = "Word (Root Dir)" }, - { "sW", LazyVim.telescope("grep_string", { cwd = false, word_match = "-w" }), desc = "Word (cwd)" }, - { "sw", LazyVim.telescope("grep_string"), mode = "v", desc = "Selection (Root Dir)" }, - { "sW", LazyVim.telescope("grep_string", { cwd = false }), mode = "v", desc = "Selection (cwd)" }, - { "uC", LazyVim.telescope("colorscheme", { enable_preview = true }), desc = "Colorscheme with Preview" }, + { "sw", LazyVim.pick("grep_string", { word_match = "-w" }), desc = "Word (Root Dir)" }, + { "sW", LazyVim.pick("grep_string", { root = false, word_match = "-w" }), desc = "Word (cwd)" }, + { "sw", LazyVim.pick("grep_string"), mode = "v", desc = "Selection (Root Dir)" }, + { "sW", LazyVim.pick("grep_string", { root = false }), mode = "v", desc = "Selection (cwd)" }, + { "uC", LazyVim.pick("colorscheme", { enable_preview = true }), desc = "Colorscheme with Preview" }, { "ss", function() @@ -247,12 +247,12 @@ return { local find_files_no_ignore = function() local action_state = require("telescope.actions.state") local line = action_state.get_current_line() - LazyVim.telescope("find_files", { no_ignore = true, default_text = line })() + LazyVim.pick("find_files", { no_ignore = true, default_text = line })() end local find_files_with_hidden = function() local action_state = require("telescope.actions.state") local line = action_state.get_current_line() - LazyVim.telescope("find_files", { hidden = true, default_text = line })() + LazyVim.pick("find_files", { hidden = true, default_text = line })() end return { diff --git a/lua/lazyvim/plugins/extras/editor/fzf.lua b/lua/lazyvim/plugins/extras/editor/fzf.lua new file mode 100644 index 00000000..89cefac1 --- /dev/null +++ b/lua/lazyvim/plugins/extras/editor/fzf.lua @@ -0,0 +1,195 @@ +---@class FzfLuaOpts: lazyvim.util.pick.Opts +---@field cmd string? + +LazyVim.pick.commands = { + files = "files", +} + +---@param command string +---@param opts? FzfLuaOpts +LazyVim.pick._open = function(command, opts) + opts = opts or {} + if opts.cmd == nil and command == "git_files" and opts.show_untracked then + opts.cmd = "git ls-files --exclude-standard --cached --others" + end + return require("fzf-lua")[command](opts) +end + +local function symbols_filter(entry, ctx) + ctx.symbols_filter = ctx.symbols_filter or require("lazyvim.config").get_kind_filter(ctx.bufnr) + return vim.tbl_contains(ctx.symbols_filter, entry.kind) +end + +return { + { + "nvim-telescope/telescope.nvim", + enabled = false, + }, + { + "ibhagwan/fzf-lua", + event = "VeryLazy", + opts = function(_, opts) + local config = require("fzf-lua.config") + local actions = require("fzf-lua.actions") + + -- Quickfix + config.defaults.keymap.fzf["ctrl-q"] = "select-all+accept" + config.defaults.keymap.builtin[""] = "preview-page-down" + config.defaults.keymap.builtin[""] = "preview-page-up" + + -- Trouble + config.defaults.actions.files["ctrl-t"] = require("trouble.sources.fzf").actions.open + + -- Toggle root dir / cwd + config.defaults.actions.files["ctrl-r"] = function(_, ctx) + local o = vim.deepcopy(ctx.__call_opts) + o.root = o.root == false + o.cwd = nil + o.buf = ctx.__CTX.bufnr + LazyVim.pick.open(ctx.__INFO.cmd, o) + end + config.defaults.actions.files["alt-c"] = config.defaults.actions.files["ctrl-r"] + + -- use the same prompt for all + local defaults = require("fzf-lua.profiles.default-title") + local function fix(t) + t.prompt = t.prompt ~= nil and " " or nil + for _, v in pairs(t) do + if type(v) == "table" then + fix(v) + end + end + end + fix(defaults) + + vim.api.nvim_set_hl(0, "FzfLuaPath", { link = "Directory", default = true }) + + return vim.tbl_deep_extend("force", opts, defaults, { + fzf_colors = true, + files = { + cwd_prompt = false, + actions = { + ["alt-i"] = { actions.toggle_ignore }, + ["alt-h"] = { actions.toggle_hidden }, + }, + }, + grep = { + formatter = "path.hl", + actions = { + ["alt-i"] = { actions.toggle_ignore }, + ["alt-h"] = { actions.toggle_hidden }, + }, + }, + formatters = { + path = { + hl = { + _to = function() + local _, escseq = require("fzf-lua.utils").ansi_from_hl("FzfLuaPath", "foo") + return [[ + return function(s, _, m) + return "]] .. (escseq or "") .. [[" + .. s .. m.utils.ansi_escseq.clear + end + ]] + end, + }, + }, + }, + }) + end, + keys = { + { "", "close", ft = "fzf", mode = "t", nowait = true }, + { "", "", ft = "fzf", mode = "t", nowait = true }, + { "", "", ft = "fzf", mode = "t", nowait = true }, + { + ",", + "FzfLua buffers sort_mru=true sort_lastused=true", + desc = "Switch Buffer", + }, + { "/", LazyVim.pick("live_grep"), desc = "Grep (Root Dir)" }, + { ":", "FzfLua command_history", desc = "Command History" }, + { "", LazyVim.pick("auto"), desc = "Find Files (Root Dir)" }, + -- find + { "fb", "FzfLua buffers sort_mru=true sort_lastused=true", desc = "Buffers" }, + { "fc", LazyVim.pick.config_files(), desc = "Find Config File" }, + { "ff", LazyVim.pick("auto"), desc = "Find Files (Root Dir)" }, + { "fF", LazyVim.pick("auto", { root = false }), desc = "Find Files (cwd)" }, + { "fg", "FzfLua git_files", desc = "Find Files (git-files)" }, + { "fr", "FzfLua oldfiles", desc = "Recent" }, + { "fR", LazyVim.pick("oldfiles", { root = false }), desc = "Recent (cwd)" }, + -- git + { "gc", "FzfLua git_commits", desc = "Commits" }, + { "gs", "FzfLua git_status", desc = "Status" }, + -- search + { 's"', "FzfLua registers", desc = "Registers" }, + { "sa", "FzfLua autocmds", desc = "Auto Commands" }, + { "sb", "FzfLua grep_curbuf", desc = "Buffer" }, + { "sc", "FzfLua command_history", desc = "Command History" }, + { "sC", "FzfLua commands", desc = "Commands" }, + { "sd", "FzfLua diagnostics_document", desc = "Document Diagnostics" }, + { "sD", "FzfLua diagnostics_workspace", desc = "Workspace Diagnostics" }, + { "sg", LazyVim.pick("live_grep"), desc = "Grep (Root Dir)" }, + { "sG", LazyVim.pick("live_grep", { root = false }), desc = "Grep (cwd)" }, + { "sh", "FzfLua help_tags", desc = "Help Pages" }, + { "sH", "FzfLua highlights", desc = "Search Highlight Groups" }, + { "sj", "FzfLua jumps", desc = "Jumplist" }, + { "sk", "FzfLua keymaps", desc = "Key Maps" }, + { "sl", "FzfLua loclist", desc = "Location List" }, + { "sM", "FzfLua man_pages", desc = "Man Pages" }, + { "sm", "FzfLua marks", desc = "Jump to Mark" }, + { "sR", "FzfLua resume", desc = "Resume" }, + { "sq", "FzfLua quickfix", desc = "Quickfix List" }, + { "sw", LazyVim.pick("grep_cword"), desc = "Word (Root Dir)" }, + { "sW", LazyVim.pick("grep_cword", { root = false }), desc = "Word (cwd)" }, + { "sw", LazyVim.pick("grep_visual"), mode = "v", desc = "Selection (Root Dir)" }, + { "sW", LazyVim.pick("grep_visual", { root = false }), mode = "v", desc = "Selection (cwd)" }, + { "uC", LazyVim.pick("colorschemes"), desc = "Colorscheme with Preview" }, + { + "ss", + function() + require("fzf-lua").lsp_document_symbols({ + regex_filter = symbols_filter, + }) + end, + desc = "Goto Symbol", + }, + { + "sS", + function() + require("fzf-lua").lsp_dynamic_workspace_symbols({ + regex_filter = symbols_filter, + }) + end, + desc = "Goto Symbol (Workspace)", + }, + }, + }, + + { + "folke/todo-comments.nvim", + optional = true, + -- stylua: ignore + keys = { + { "st", function() require("todo-comments.fzf").todo() end, desc = "Todo" }, + { "sT", function () require("todo-comments.fzf").todo({ keywords = { "TODO", "FIX", "FIXME" } }) end, desc = "Todo/Fix/Fixme" }, + }, + }, + + { + "neovim/nvim-lspconfig", + opts = function() + local Keys = require("lazyvim.plugins.lsp.keymaps").get() + vim.list_extend(Keys, { + { + "gd", + "FzfLua lsp_definitions jump_to_single_result=true", + desc = "Goto Definition", + has = "definition", + }, + { "gr", "FzfLua lsp_references jump_to_single_result=true", desc = "References", nowait = true }, + { "gI", "FzfLua lsp_implementations jump_to_single_result=true", desc = "Goto Implementation" }, + { "gy", "FzfLua lsp_typedefs jump_to_single_result=true", desc = "Goto T[y]pe Definition" }, + }) + end, + }, +} diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index e3c7aa87..c9bc8b6a 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -343,11 +343,11 @@ return { header = vim.split(logo, "\n"), -- stylua: ignore center = { - { action = LazyVim.telescope("files"), desc = " Find File", icon = " ", key = "f" }, + { action = LazyVim.pick(), desc = " Find File", icon = " ", key = "f" }, { action = "ene | startinsert", desc = " New File", icon = " ", key = "n" }, - { action = "Telescope oldfiles", desc = " Recent Files", icon = " ", key = "r" }, - { action = "Telescope live_grep", desc = " Find Text", icon = " ", key = "g" }, - { action = [[lua LazyVim.telescope.config_files()()]], desc = " Config", icon = " ", key = "c" }, + { action = LazyVim.pick("oldfiles"), desc = " Recent Files", icon = " ", key = "r" }, + { action = LazyVim.pick("live_grep"), desc = " Find Text", icon = " ", key = "g" }, + { action = 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" }, diff --git a/lua/lazyvim/util/init.lua b/lua/lazyvim/util/init.lua index d8f485ed..94704228 100644 --- a/lua/lazyvim/util/init.lua +++ b/lua/lazyvim/util/init.lua @@ -17,6 +17,7 @@ local LazyUtil = require("lazy.core.util") ---@field json lazyvim.util.json ---@field lualine lazyvim.util.lualine ---@field mini lazyvim.util.mini +---@field pick lazyvim.util.pick ---@field cmp lazyvim.util.cmp local M = {} @@ -281,4 +282,5 @@ function M.memoize(fn) return cache[key] end end + return M diff --git a/lua/lazyvim/util/pick.lua b/lua/lazyvim/util/pick.lua new file mode 100644 index 00000000..30160215 --- /dev/null +++ b/lua/lazyvim/util/pick.lua @@ -0,0 +1,72 @@ +---@class lazyvim.util.pick +---@overload fun(command:string, opts?:lazyvim.util.pick.Opts): fun() +local M = setmetatable({}, { + __call = function(m, ...) + return m.wrap(...) + end, +}) + +---@class lazyvim.util.pick.Opts: table +---@field root? boolean +---@field cwd? string +---@field buf? number +---@field show_untracked? boolean + +---@type table +M.commands = { + files = "find_files", +} + +---@param command? string +---@param opts? lazyvim.util.pick.Opts +function M.open(command, opts) + command = command or "auto" + opts = opts or {} + + opts = vim.deepcopy(opts) + + if type(opts.cwd) == "boolean" then + LazyVim.warn("LazyVim.pick: opts.cwd should be a string or nil") + opts.cwd = nil + end + + if not opts.cwd and opts.root ~= false then + opts.cwd = LazyVim.root({ buf = opts.buf }) + end + + local cwd = opts.cwd or vim.uv.cwd() + if command == "auto" then + command = "files" + if + vim.uv.fs_stat(cwd .. "/.git") + and not vim.uv.fs_stat(cwd .. "/.ignore") + and not vim.uv.fs_stat(cwd .. "/.rgignore") + then + command = "git_files" + opts.show_untracked = opts.show_untracked ~= false + end + end + command = M.commands[command] or command + M._open(command, opts) +end + +---@param command? string +---@param opts? lazyvim.util.pick.Opts +function M.wrap(command, opts) + opts = opts or {} + return function() + M.open(command, vim.deepcopy(opts)) + end +end + +---@param command string +---@param opts? lazyvim.util.pick.Opts +function M._open(command, opts) + return LazyVim.telescope.open(command, opts) +end + +function M.config_files() + return M.wrap("files", { cwd = vim.fn.stdpath("config") }) +end + +return M diff --git a/lua/lazyvim/util/root.lua b/lua/lazyvim/util/root.lua index 4523f3cf..a401ccf4 100644 --- a/lua/lazyvim/util/root.lua +++ b/lua/lazyvim/util/root.lua @@ -168,13 +168,14 @@ end -- * lsp root_dir -- * root pattern of filename of the current buffer -- * root pattern of cwd ----@param opts? {normalize?:boolean} +---@param opts? {normalize?:boolean, buf?:number} ---@return string function M.get(opts) - local buf = vim.api.nvim_get_current_buf() + opts = opts or {} + local buf = opts.buf or vim.api.nvim_get_current_buf() local ret = M.cache[buf] if not ret then - local roots = M.detect({ all = false }) + local roots = M.detect({ all = false, buf = buf }) ret = roots[1] and roots[1].paths[1] or vim.uv.cwd() M.cache[buf] = ret end diff --git a/lua/lazyvim/util/telescope.lua b/lua/lazyvim/util/telescope.lua index bb030627..b6414d2c 100644 --- a/lua/lazyvim/util/telescope.lua +++ b/lua/lazyvim/util/telescope.lua @@ -1,9 +1,5 @@ ----@class lazyvim.util.telescope.opts ----@field cwd? string|boolean ----@field show_untracked? boolean - ---@class lazyvim.util.telescope ----@overload fun(builtin:string, opts?:lazyvim.util.telescope.opts) +---@overload fun(builtin:string, opts?:lazyvim.util.pick.Opts) local M = setmetatable({}, { __call = function(m, ...) return m.telescope(...) @@ -14,50 +10,39 @@ local M = setmetatable({}, { -- cwd will default to lazyvim.util.get_root -- for `files`, git_files or find_files will be chosen depending on .git ---@param builtin string ----@param opts? lazyvim.util.telescope.opts -function M.telescope(builtin, opts) - local params = { builtin = builtin, opts = opts } - return function() - builtin = params.builtin - opts = params.opts - opts = vim.tbl_deep_extend("force", { cwd = LazyVim.root() }, opts or {}) --[[@as lazyvim.util.telescope.opts]] - if builtin == "files" then - if - vim.uv.fs_stat((opts.cwd or vim.uv.cwd()) .. "/.git") - and not vim.uv.fs_stat((opts.cwd or vim.uv.cwd()) .. "/.ignore") - and not vim.uv.fs_stat((opts.cwd or vim.uv.cwd()) .. "/.rgignore") - then - if opts.show_untracked == nil then - opts.show_untracked = true - end - builtin = "git_files" - else - builtin = "find_files" - end +---@param opts? lazyvim.util.pick.Opts +function M.open(builtin, opts) + opts = opts or {} + if opts.cwd and opts.cwd ~= vim.uv.cwd() then + local function open_cwd_dir() + local action_state = require("telescope.actions.state") + local line = action_state.get_current_line() + LazyVim.pick.open( + builtin, + vim.tbl_deep_extend("force", {}, opts or {}, { + root = false, + default_text = line, + }) + ) end - if opts.cwd and opts.cwd ~= vim.uv.cwd() then - local function open_cwd_dir() - local action_state = require("telescope.actions.state") - local line = action_state.get_current_line() - M.telescope( - params.builtin, - vim.tbl_deep_extend("force", {}, params.opts or {}, { cwd = false, default_text = line }) - )() - end - ---@diagnostic disable-next-line: inject-field - opts.attach_mappings = function(_, map) - -- opts.desc is overridden by telescope, until it's changed there is this fix - map("i", "", open_cwd_dir, { desc = "Open cwd Directory" }) - return true - end + ---@diagnostic disable-next-line: inject-field + opts.attach_mappings = function(_, map) + -- opts.desc is overridden by telescope, until it's changed there is this fix + map("i", "", open_cwd_dir, { desc = "Open cwd Directory" }) + return true end - - require("telescope.builtin")[builtin](opts) end + + require("telescope.builtin")[builtin](opts) +end + +M.telescope = function(...) + LazyVim.deprecate("LazyVim.telescope", "LazyVim.pick") + return LazyVim.pick.wrap(...) end function M.config_files() - return LazyVim.telescope("find_files", { cwd = vim.fn.stdpath("config") }) + return LazyVim.pick.config_files() end return M From f5dc867ac29e31f833442006ebe3daf7540d1f69 Mon Sep 17 00:00:00 2001 From: Muneeb Usmani Date: Tue, 11 Jun 2024 01:01:24 +0500 Subject: [PATCH 004/323] fix(php): formatting and linting (#3540) Fixed the issue of php formatting not working in extras.lang.php --- lua/lazyvim/plugins/extras/lang/php.lua | 41 ++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/php.lua b/lua/lazyvim/plugins/extras/lang/php.lua index 334091bb..0cb3a840 100644 --- a/lua/lazyvim/plugins/extras/lang/php.lua +++ b/lua/lazyvim/plugins/extras/lang/php.lua @@ -18,12 +18,23 @@ return { }, }, + { + "williamboman/mason.nvim", + opts = { + ensure_installed = { + "phpcs", + "php-cs-fixer", + }, + }, + }, { "mfussenegger/nvim-dap", optional = true, dependencies = { "williamboman/mason.nvim", - opts = { ensure_installed = { "php-debug-adapter" } }, + opts = { ensure_installed = { + "php-debug-adapter", + } }, }, opts = function() local dap = require("dap") @@ -35,4 +46,32 @@ return { } end, }, + { + "nvimtools/none-ls.nvim", + optional = true, + opts = function(_, opts) + local nls = require("null-ls") + opts.sources = opts.sources or {} + table.insert(opts.sources, nls.builtins.formatting.phpcsfixer) + table.insert(opts.sources, nls.builtins.diagnostics.phpcs) + end, + }, + { + "mfussenegger/nvim-lint", + optional = true, + opts = { + linters_by_ft = { + php = { "phpcs" }, + }, + }, + { + "stevearc/conform.nvim", + optional = true, + opts = { + formatters_by_ft = { + php = { "php-cs-fixer" }, + }, + }, + }, + }, } From 21617a9d602f2400c8e9813490958e106cb88ca8 Mon Sep 17 00:00:00 2001 From: dotfrag <17456867+dotfrag@users.noreply.github.com> Date: Mon, 10 Jun 2024 23:06:09 +0300 Subject: [PATCH 005/323] feat(lualine): show readonly icon (#3567) Adds a configurable lock icon when a file is opened as read only. Mimics `vi -R ` status line. --- lua/lazyvim/util/lualine.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/util/lualine.lua b/lua/lazyvim/util/lualine.lua index 3e546873..aad22677 100644 --- a/lua/lazyvim/util/lualine.lua +++ b/lua/lazyvim/util/lualine.lua @@ -72,7 +72,7 @@ function M.format(component, text, hl_group) return component:format_hl(lualine_hl_group) .. text .. component:get_default_hl() end ----@param opts? {relative: "cwd"|"root", modified_hl: string?, directory_hl: string?, filename_hl: string?} +---@param opts? {relative: "cwd"|"root", modified_hl: string?, directory_hl: string?, filename_hl: string?, modified_sign: string?, readonly_icon: string?, length: number?} function M.pretty_path(opts) opts = vim.tbl_extend("force", { relative = "cwd", @@ -80,6 +80,7 @@ function M.pretty_path(opts) directory_hl = "", filename_hl = "Bold", modified_sign = "", + readonly_icon = " 󰌾 ", length = 3, }, opts or {}) @@ -120,7 +121,12 @@ function M.pretty_path(opts) dir = table.concat({ unpack(parts, 1, #parts - 1) }, sep) dir = M.format(self, dir .. sep, opts.directory_hl) end - return dir .. parts[#parts] + + local readonly = "" + if vim.bo.readonly then + readonly = M.format(self, opts.readonly_icon, opts.modified_hl) + end + return dir .. parts[#parts] .. readonly end end From fe667b53c9db6c77b3baa4a80780d12af80f08e0 Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Mon, 10 Jun 2024 23:12:25 +0300 Subject: [PATCH 006/323] refactor(mini-files): mini-files (#3538) Incorporate additional boolean logic when setting keymaps to avoid creating `opts.mappings` table and leave that only from the user configuration to change mappings. --- .../plugins/extras/editor/mini-files.lua | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/lua/lazyvim/plugins/extras/editor/mini-files.lua b/lua/lazyvim/plugins/extras/editor/mini-files.lua index 2261567d..7f677ebf 100644 --- a/lua/lazyvim/plugins/extras/editor/mini-files.lua +++ b/lua/lazyvim/plugins/extras/editor/mini-files.lua @@ -1,14 +1,6 @@ return { "echasnovski/mini.files", opts = { - mappings = { - toggle_hidden = "g.", - change_cwd = "gc", - go_in_horizontal = "s", - go_in_vertical = "v", - go_in_horizontal_plus = "S", - go_in_vertical_plus = "V", - }, windows = { preview = true, width_focus = 30, @@ -90,17 +82,22 @@ return { vim.keymap.set( "n", - opts.mappings.toggle_hidden, + opts.mappings and opts.mappings.toggle_hidden or "g.", toggle_dotfiles, { buffer = buf_id, desc = "Toggle hidden files" } ) - vim.keymap.set("n", opts.mappings.change_cwd, files_set_cwd, { buffer = args.data.buf_id, desc = "Set cwd" }) + vim.keymap.set( + "n", + opts.mappings and opts.mappings.change_cwd or "gc", + files_set_cwd, + { buffer = args.data.buf_id, desc = "Set cwd" } + ) - map_split(buf_id, opts.mappings.go_in_horizontal, "horizontal", false) - map_split(buf_id, opts.mappings.go_in_vertical, "vertical", false) - map_split(buf_id, opts.mappings.go_in_horizontal_plus, "horizontal", true) - map_split(buf_id, opts.mappings.go_in_vertical_plus, "vertical", true) + map_split(buf_id, opts.mappings and opts.mappings.go_in_horizontal or "s", "horizontal", false) + map_split(buf_id, opts.mappings and opts.mappings.go_in_vertical or "v", "vertical", false) + map_split(buf_id, opts.mappings and opts.mappings.go_in_horizontal_plus or "S", "horizontal", true) + map_split(buf_id, opts.mappings and opts.mappings.go_in_vertical_plus or "V", "vertical", true) end, }) From 9b5d810c05aaa21300aa89bb7386cc25927da4ef Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 10 Jun 2024 23:26:07 +0200 Subject: [PATCH 007/323] docs: added experience to CONTRIBUTING --- CONTRIBUTING.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 16198586..d08a3622 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,6 +17,9 @@ ## Contributing an Extra Language +- You should be familiar with the language you are adding. +- You should have experience with the language's ecosystem, including formatters, + linters, and LSP servers. - The extra should include the setup most widely used by the community. - Include Tree-sitter parsers that are not yet the default. - Include the most widely used LSP server setup. From 7d30360df29e0d02dd946521ff7fbfeea201b142 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 11 Jun 2024 00:06:56 +0200 Subject: [PATCH 008/323] refactor: config = true >> opts = {} --- lua/lazyvim/plugins/editor.lua | 2 +- lua/lazyvim/plugins/extras/lang/go.lua | 2 +- lua/lazyvim/plugins/extras/lang/tailwind.lua | 2 +- lua/lazyvim/plugins/init.lua | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index d4a1c7fb..90e68da7 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -471,7 +471,7 @@ return { "folke/todo-comments.nvim", cmd = { "TodoTrouble", "TodoTelescope" }, event = "LazyFile", - config = true, + opts = {}, -- stylua: ignore keys = { { "]t", function() require("todo-comments").jump_next() end, desc = "Next Todo Comment" }, diff --git a/lua/lazyvim/plugins/extras/lang/go.lua b/lua/lazyvim/plugins/extras/lang/go.lua index b3e0ffab..58c48643 100644 --- a/lua/lazyvim/plugins/extras/lang/go.lua +++ b/lua/lazyvim/plugins/extras/lang/go.lua @@ -121,7 +121,7 @@ return { }, { "leoluz/nvim-dap-go", - config = true, + opts = {}, }, }, }, diff --git a/lua/lazyvim/plugins/extras/lang/tailwind.lua b/lua/lazyvim/plugins/extras/lang/tailwind.lua index 17ed92ef..def150a3 100644 --- a/lua/lazyvim/plugins/extras/lang/tailwind.lua +++ b/lua/lazyvim/plugins/extras/lang/tailwind.lua @@ -49,7 +49,7 @@ return { { "hrsh7th/nvim-cmp", dependencies = { - { "roobert/tailwindcss-colorizer-cmp.nvim", config = true }, + { "roobert/tailwindcss-colorizer-cmp.nvim", opts = {} }, }, opts = function(_, opts) -- original LazyVim kind icon formatter diff --git a/lua/lazyvim/plugins/init.lua b/lua/lazyvim/plugins/init.lua index 8c7b5fa1..4a43f115 100644 --- a/lua/lazyvim/plugins/init.lua +++ b/lua/lazyvim/plugins/init.lua @@ -12,5 +12,5 @@ require("lazyvim.config").init() return { { "folke/lazy.nvim", version = "*" }, - { "LazyVim/LazyVim", priority = 10000, lazy = false, config = true, cond = true, version = "*" }, + { "LazyVim/LazyVim", priority = 10000, lazy = false, opts = {}, cond = true, version = "*" }, } From 335487282a128d6df7ea021a75b31f07a2b9ccfd Mon Sep 17 00:00:00 2001 From: Aofei Sheng Date: Tue, 11 Jun 2024 12:41:37 +0800 Subject: [PATCH 009/323] fix(util): ensure unique cache keys in LazyVim.memoize (#3576) ## What is this PR for? This PR fixes a bug in the `LazyVim.memoize` function that was causing unexpected behavior in my configuration. The issue was discovered when setting `vim.g.lazyvim_prettier_needs_config = true` in my `lua/config/options.lua`, which did not work as expected. The root cause was an issue with `LazyVim.memoize` cache key generation, which led to `M.has_config(ctx)` always returning the same result as `M.has_parser(ctx)`. This happened because `LazyVim.memoize` generates cache keys based on the function parameters, and both functions were being called with identical parameters: https://github.com/LazyVim/LazyVim/blob/7d30360df29e0d02dd946521ff7fbfeea201b142/lua/lazyvim/plugins/extras/formatting/prettier.lua#L77-L81 By improving the cache key generation to include function information, we can ensure unique keys for different functions even if their parameters are identical, thereby fixing the issue. ## Does this PR fix an existing issue? N/A ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/util/init.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/util/init.lua b/lua/lazyvim/util/init.lua index 94704228..fb1c9606 100644 --- a/lua/lazyvim/util/init.lua +++ b/lua/lazyvim/util/init.lua @@ -274,8 +274,10 @@ local cache = {} ---@type table ---@param fn T ---@return T function M.memoize(fn) + local info = debug.getinfo(fn, "S") + local keyprefix = info.source .. ":" .. info.linedefined .. ":" return function(...) - local key = vim.inspect({ ... }) + local key = keyprefix .. vim.inspect({ ... }) if cache[key] == nil then cache[key] = fn(...) end From 3b447a8037b202dbaffd4da70656af82229197fe Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 11 Jun 2024 04:42:12 +0000 Subject: [PATCH 010/323] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 3741c67c..b1dcfb85 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 10 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 11 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 14d47f650c44b6dfd531a4208a450104af090689 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 11 Jun 2024 06:51:30 +0200 Subject: [PATCH 011/323] refactor: memoize --- lua/lazyvim/util/init.lua | 13 ++++++------- tests/util/util_spec.lua | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 7 deletions(-) create mode 100644 tests/util/util_spec.lua diff --git a/lua/lazyvim/util/init.lua b/lua/lazyvim/util/init.lua index fb1c9606..4a1478e6 100644 --- a/lua/lazyvim/util/init.lua +++ b/lua/lazyvim/util/init.lua @@ -269,19 +269,18 @@ for _, level in ipairs({ "info", "warn", "error" }) do end end -local cache = {} ---@type table +local cache = {} ---@type table<(fun()), table> ---@generic T: fun() ---@param fn T ---@return T function M.memoize(fn) - local info = debug.getinfo(fn, "S") - local keyprefix = info.source .. ":" .. info.linedefined .. ":" return function(...) - local key = keyprefix .. vim.inspect({ ... }) - if cache[key] == nil then - cache[key] = fn(...) + local key = vim.inspect({ ... }) + cache[fn] = cache[fn] or {} + if cache[fn][key] == nil then + cache[fn][key] = fn(...) end - return cache[key] + return cache[fn][key] end end diff --git a/tests/util/util_spec.lua b/tests/util/util_spec.lua new file mode 100644 index 00000000..0839eefe --- /dev/null +++ b/tests/util/util_spec.lua @@ -0,0 +1,36 @@ +---@module "luassert" + +local LazyVim = require("lazyvim.util") + +describe("util", function() + local t = 0 + local fn = function(a) + t = t + 1 + return a + end + + local m = LazyVim.memoize(fn) + + it("should memoize a function", function() + local a = m(1) + local b = m(1) + local c = m(2) + assert.are.equal(a, b) + assert.are.equal(a, 1) + assert.are.equal(c, 2) + assert.are.equal(t, 2) + assert.are_not.equal(a, c) + end) + + local f1 = LazyVim.memoize(function() + return 1 + end) + local f2 = LazyVim.memoize(function() + return 2 + end) + + it("should memoize based on the correct key", function() + assert.are.equal(f1(), 1) + assert.are.equal(f2(), 2) + end) +end) From 9b8a393edc8b9a12a39f712163f6476c084a7f71 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 11 Jun 2024 06:55:16 +0200 Subject: [PATCH 012/323] fix(dap): set host to 127.0.0.1 instead of localhost to prevent issues with ipv6. Fixes #3577 --- lua/lazyvim/plugins/extras/lang/clangd.lua | 2 +- lua/lazyvim/plugins/extras/lang/kotlin.lua | 2 +- lua/lazyvim/plugins/extras/lang/typescript.lua | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/clangd.lua b/lua/lazyvim/plugins/extras/lang/clangd.lua index dccbc9cb..09294970 100644 --- a/lua/lazyvim/plugins/extras/lang/clangd.lua +++ b/lua/lazyvim/plugins/extras/lang/clangd.lua @@ -123,7 +123,7 @@ return { if not dap.adapters["codelldb"] then require("dap").adapters["codelldb"] = { type = "server", - host = "localhost", + host = "127.0.0.1", port = "${port}", executable = { command = "codelldb", diff --git a/lua/lazyvim/plugins/extras/lang/kotlin.lua b/lua/lazyvim/plugins/extras/lang/kotlin.lua index a15f3cc4..9e757722 100644 --- a/lua/lazyvim/plugins/extras/lang/kotlin.lua +++ b/lua/lazyvim/plugins/extras/lang/kotlin.lua @@ -104,7 +104,7 @@ return { port = 5005, args = {}, projectRoot = vim.fn.getcwd, - hostName = "localhost", + hostName = "127.0.0.1", timeout = 2000, }, } diff --git a/lua/lazyvim/plugins/extras/lang/typescript.lua b/lua/lazyvim/plugins/extras/lang/typescript.lua index 139c3086..3015c86d 100644 --- a/lua/lazyvim/plugins/extras/lang/typescript.lua +++ b/lua/lazyvim/plugins/extras/lang/typescript.lua @@ -194,7 +194,7 @@ return { if not dap.adapters["pwa-node"] then require("dap").adapters["pwa-node"] = { type = "server", - host = "localhost", + host = "127.0.0.1", port = "${port}", executable = { command = "node", From 638769d32005f4b82d8d83f89539b2d47baf909a Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 11 Jun 2024 07:27:04 +0200 Subject: [PATCH 013/323] test: simple test to make sure I don't keep debug stuff around --- tests/dd_spec.lua | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 tests/dd_spec.lua diff --git a/tests/dd_spec.lua b/tests/dd_spec.lua new file mode 100644 index 00000000..6304e966 --- /dev/null +++ b/tests/dd_spec.lua @@ -0,0 +1,6 @@ +describe("Should not have", function() + it("dd()", function() + local out = vim.fn.system([[/bin/grep --line-number -r '\\bdd(' lua]]) + assert(vim.v.shell_error == 1, "Should not have dd()\n" .. out) + end) +end) From ba3aec7b4876e36a9f9fd3cce1d204c23c0fe24f Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 11 Jun 2024 07:42:21 +0200 Subject: [PATCH 014/323] feat(fzf): prettier document symbols --- lua/lazyvim/plugins/extras/editor/fzf.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lua/lazyvim/plugins/extras/editor/fzf.lua b/lua/lazyvim/plugins/extras/editor/fzf.lua index 89cefac1..9176ea36 100644 --- a/lua/lazyvim/plugins/extras/editor/fzf.lua +++ b/lua/lazyvim/plugins/extras/editor/fzf.lua @@ -80,6 +80,17 @@ return { ["alt-h"] = { actions.toggle_hidden }, }, }, + lsp = { + symbols = { + symbol_hl = function(s) + return "TroubleIcon" .. s + end, + symbol_fmt = function(s) + return s .. "\t" + end, + child_prefix = false, + }, + }, formatters = { path = { hl = { From d1d24fa077add680bc532e08fd68aaa0841a14dc Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 11 Jun 2024 07:44:32 +0200 Subject: [PATCH 015/323] fix(fzf): lowercase symbols --- lua/lazyvim/plugins/extras/editor/fzf.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/editor/fzf.lua b/lua/lazyvim/plugins/extras/editor/fzf.lua index 9176ea36..5ed940b2 100644 --- a/lua/lazyvim/plugins/extras/editor/fzf.lua +++ b/lua/lazyvim/plugins/extras/editor/fzf.lua @@ -86,7 +86,7 @@ return { return "TroubleIcon" .. s end, symbol_fmt = function(s) - return s .. "\t" + return s:lower() .. "\t" end, child_prefix = false, }, From 8bb653876c38518e4befb496b78659e76ed7afee Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 11 Jun 2024 09:04:39 +0200 Subject: [PATCH 016/323] feat(fzf): better scrollbars --- lua/lazyvim/plugins/extras/editor/fzf.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lua/lazyvim/plugins/extras/editor/fzf.lua b/lua/lazyvim/plugins/extras/editor/fzf.lua index 5ed940b2..31ffc1ec 100644 --- a/lua/lazyvim/plugins/extras/editor/fzf.lua +++ b/lua/lazyvim/plugins/extras/editor/fzf.lua @@ -66,6 +66,14 @@ return { return vim.tbl_deep_extend("force", opts, defaults, { fzf_colors = true, + fzf_opts = { + ["--no-scrollbar"] = true, + }, + winopts = { + preview = { + scrollchars = { "┃", "" }, + }, + }, files = { cwd_prompt = false, actions = { From c4818616d541e4456850d1982be39b8151bd0f2a Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 11 Jun 2024 09:05:16 +0200 Subject: [PATCH 017/323] feat(fzf): ignore current line for some lsp pickers --- lua/lazyvim/plugins/extras/editor/fzf.lua | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/lua/lazyvim/plugins/extras/editor/fzf.lua b/lua/lazyvim/plugins/extras/editor/fzf.lua index 31ffc1ec..241eb526 100644 --- a/lua/lazyvim/plugins/extras/editor/fzf.lua +++ b/lua/lazyvim/plugins/extras/editor/fzf.lua @@ -198,16 +198,12 @@ return { "neovim/nvim-lspconfig", opts = function() local Keys = require("lazyvim.plugins.lsp.keymaps").get() + -- stylua: ignore vim.list_extend(Keys, { - { - "gd", - "FzfLua lsp_definitions jump_to_single_result=true", - desc = "Goto Definition", - has = "definition", - }, - { "gr", "FzfLua lsp_references jump_to_single_result=true", desc = "References", nowait = true }, - { "gI", "FzfLua lsp_implementations jump_to_single_result=true", desc = "Goto Implementation" }, - { "gy", "FzfLua lsp_typedefs jump_to_single_result=true", desc = "Goto T[y]pe Definition" }, + { "gd", "FzfLua lsp_definitions jump_to_single_result=true ignore_current_line=true", desc = "Goto Definition", has = "definition" }, + { "gr", "FzfLua lsp_references jump_to_single_result=true ignore_current_line=true", desc = "References", nowait = true }, + { "gI", "FzfLua lsp_implementations jump_to_single_result=true ignore_current_line=true", desc = "Goto Implementation" }, + { "gy", "FzfLua lsp_typedefs jump_to_single_result=true ignore_current_line=true", desc = "Goto T[y]pe Definition" }, }) end, }, From bd29f4515307f59437995d5cc0ba601eb02b5baa Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 11 Jun 2024 09:10:10 +0200 Subject: [PATCH 018/323] fix(sql): make sure edgebars exist. Fixes #3578 --- lua/lazyvim/plugins/extras/lang/sql.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/lazyvim/plugins/extras/lang/sql.lua b/lua/lazyvim/plugins/extras/lang/sql.lua index 4f185ab1..6eee33a6 100644 --- a/lua/lazyvim/plugins/extras/lang/sql.lua +++ b/lua/lazyvim/plugins/extras/lang/sql.lua @@ -75,6 +75,7 @@ return { "folke/edgy.nvim", optional = true, opts = function(_, opts) + opts.right = opts.right or {} table.insert(opts.right, { title = "Database", ft = "dbui", @@ -85,6 +86,7 @@ return { end, }) + opts.bottom = opts.bottom or {} table.insert(opts.bottom, { title = "DB Query Result", ft = "dbout", From d541069fdffcf5ffaf2a7f161fd87bb68094c8cf Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 11 Jun 2024 14:26:46 +0200 Subject: [PATCH 019/323] fix(pick): recent files in cwd. Fixes #3580 --- lua/lazyvim/plugins/editor.lua | 2 +- lua/lazyvim/plugins/extras/editor/fzf.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 90e68da7..c41a5db7 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -190,7 +190,7 @@ return { { "fF", LazyVim.pick("auto", { root = false }), desc = "Find Files (cwd)" }, { "fg", "Telescope git_files", desc = "Find Files (git-files)" }, { "fr", "Telescope oldfiles", desc = "Recent" }, - { "fR", LazyVim.pick("oldfiles"), desc = "Recent (cwd)" }, + { "fR", LazyVim.pick("oldfiles", { cwd = vim.uv.cwd() }), desc = "Recent (cwd)" }, -- git { "gc", "Telescope git_commits", desc = "Commits" }, { "gs", "Telescope git_status", desc = "Status" }, diff --git a/lua/lazyvim/plugins/extras/editor/fzf.lua b/lua/lazyvim/plugins/extras/editor/fzf.lua index 241eb526..4b519202 100644 --- a/lua/lazyvim/plugins/extras/editor/fzf.lua +++ b/lua/lazyvim/plugins/extras/editor/fzf.lua @@ -135,7 +135,7 @@ return { { "fF", LazyVim.pick("auto", { root = false }), desc = "Find Files (cwd)" }, { "fg", "FzfLua git_files", desc = "Find Files (git-files)" }, { "fr", "FzfLua oldfiles", desc = "Recent" }, - { "fR", LazyVim.pick("oldfiles", { root = false }), desc = "Recent (cwd)" }, + { "fR", LazyVim.pick("oldfiles", { cwd = vim.uv.cwd() }), desc = "Recent (cwd)" }, -- git { "gc", "FzfLua git_commits", desc = "Commits" }, { "gs", "FzfLua git_status", desc = "Status" }, From 26e3e39f2eb1251841f5574f29c7eecb55fef816 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 11 Jun 2024 14:35:51 +0200 Subject: [PATCH 020/323] chore(main): release 12.12.0 (#3574) :robot: I have created a release *beep* *boop* --- ## [12.12.0](https://github.com/LazyVim/LazyVim/compare/v12.11.0...v12.12.0) (2024-06-11) ### Features * **extras:** added fzf-lua ([#3555](https://github.com/LazyVim/LazyVim/issues/3555)) ([6ab4041](https://github.com/LazyVim/LazyVim/commit/6ab404134db6004aab13dcf956e200ff063b2d42)) * **fzf:** better scrollbars ([8bb6538](https://github.com/LazyVim/LazyVim/commit/8bb653876c38518e4befb496b78659e76ed7afee)) * **fzf:** ignore current line for some lsp pickers ([c481861](https://github.com/LazyVim/LazyVim/commit/c4818616d541e4456850d1982be39b8151bd0f2a)) * **fzf:** prettier document symbols ([ba3aec7](https://github.com/LazyVim/LazyVim/commit/ba3aec7b4876e36a9f9fd3cce1d204c23c0fe24f)) * **lualine:** show readonly icon ([#3567](https://github.com/LazyVim/LazyVim/issues/3567)) ([21617a9](https://github.com/LazyVim/LazyVim/commit/21617a9d602f2400c8e9813490958e106cb88ca8)) ### Bug Fixes * **dap:** set host to 127.0.0.1 instead of localhost to prevent issues with ipv6. Fixes [#3577](https://github.com/LazyVim/LazyVim/issues/3577) ([9b8a393](https://github.com/LazyVim/LazyVim/commit/9b8a393edc8b9a12a39f712163f6476c084a7f71)) * **extras.copilot-chat:** small ui fix for which-key in visual mode ([#3573](https://github.com/LazyVim/LazyVim/issues/3573)) ([43afed1](https://github.com/LazyVim/LazyVim/commit/43afed121195df6591d0e941b913b98f849c8af3)) * **fzf:** lowercase symbols ([d1d24fa](https://github.com/LazyVim/LazyVim/commit/d1d24fa077add680bc532e08fd68aaa0841a14dc)) * **neo-tree:** use last window for preview ([#3560](https://github.com/LazyVim/LazyVim/issues/3560)) ([caaa6c4](https://github.com/LazyVim/LazyVim/commit/caaa6c440d5c3b80c03cad1dfd93989b852bb875)) * **php:** formatting and linting ([#3540](https://github.com/LazyVim/LazyVim/issues/3540)) ([f5dc867](https://github.com/LazyVim/LazyVim/commit/f5dc867ac29e31f833442006ebe3daf7540d1f69)) * **pick:** recent files in cwd. Fixes [#3580](https://github.com/LazyVim/LazyVim/issues/3580) ([d541069](https://github.com/LazyVim/LazyVim/commit/d541069fdffcf5ffaf2a7f161fd87bb68094c8cf)) * **sql:** make sure edgebars exist. Fixes [#3578](https://github.com/LazyVim/LazyVim/issues/3578) ([bd29f45](https://github.com/LazyVim/LazyVim/commit/bd29f4515307f59437995d5cc0ba601eb02b5baa)) * **util:** ensure unique cache keys in LazyVim.memoize ([#3576](https://github.com/LazyVim/LazyVim/issues/3576)) ([3354872](https://github.com/LazyVim/LazyVim/commit/335487282a128d6df7ea021a75b31f07a2b9ccfd)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a0d7187f..3c522ed8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,28 @@ # Changelog +## [12.12.0](https://github.com/LazyVim/LazyVim/compare/v12.11.0...v12.12.0) (2024-06-11) + + +### Features + +* **extras:** added fzf-lua ([#3555](https://github.com/LazyVim/LazyVim/issues/3555)) ([6ab4041](https://github.com/LazyVim/LazyVim/commit/6ab404134db6004aab13dcf956e200ff063b2d42)) +* **fzf:** better scrollbars ([8bb6538](https://github.com/LazyVim/LazyVim/commit/8bb653876c38518e4befb496b78659e76ed7afee)) +* **fzf:** ignore current line for some lsp pickers ([c481861](https://github.com/LazyVim/LazyVim/commit/c4818616d541e4456850d1982be39b8151bd0f2a)) +* **fzf:** prettier document symbols ([ba3aec7](https://github.com/LazyVim/LazyVim/commit/ba3aec7b4876e36a9f9fd3cce1d204c23c0fe24f)) +* **lualine:** show readonly icon ([#3567](https://github.com/LazyVim/LazyVim/issues/3567)) ([21617a9](https://github.com/LazyVim/LazyVim/commit/21617a9d602f2400c8e9813490958e106cb88ca8)) + + +### Bug Fixes + +* **dap:** set host to 127.0.0.1 instead of localhost to prevent issues with ipv6. Fixes [#3577](https://github.com/LazyVim/LazyVim/issues/3577) ([9b8a393](https://github.com/LazyVim/LazyVim/commit/9b8a393edc8b9a12a39f712163f6476c084a7f71)) +* **extras.copilot-chat:** small ui fix for which-key in visual mode ([#3573](https://github.com/LazyVim/LazyVim/issues/3573)) ([43afed1](https://github.com/LazyVim/LazyVim/commit/43afed121195df6591d0e941b913b98f849c8af3)) +* **fzf:** lowercase symbols ([d1d24fa](https://github.com/LazyVim/LazyVim/commit/d1d24fa077add680bc532e08fd68aaa0841a14dc)) +* **neo-tree:** use last window for preview ([#3560](https://github.com/LazyVim/LazyVim/issues/3560)) ([caaa6c4](https://github.com/LazyVim/LazyVim/commit/caaa6c440d5c3b80c03cad1dfd93989b852bb875)) +* **php:** formatting and linting ([#3540](https://github.com/LazyVim/LazyVim/issues/3540)) ([f5dc867](https://github.com/LazyVim/LazyVim/commit/f5dc867ac29e31f833442006ebe3daf7540d1f69)) +* **pick:** recent files in cwd. Fixes [#3580](https://github.com/LazyVim/LazyVim/issues/3580) ([d541069](https://github.com/LazyVim/LazyVim/commit/d541069fdffcf5ffaf2a7f161fd87bb68094c8cf)) +* **sql:** make sure edgebars exist. Fixes [#3578](https://github.com/LazyVim/LazyVim/issues/3578) ([bd29f45](https://github.com/LazyVim/LazyVim/commit/bd29f4515307f59437995d5cc0ba601eb02b5baa)) +* **util:** ensure unique cache keys in LazyVim.memoize ([#3576](https://github.com/LazyVim/LazyVim/issues/3576)) ([3354872](https://github.com/LazyVim/LazyVim/commit/335487282a128d6df7ea021a75b31f07a2b9ccfd)) + ## [12.11.0](https://github.com/LazyVim/LazyVim/compare/v12.10.0...v12.11.0) (2024-06-09) From 19a6e2de158e63264aaa761228a1e3f9d615bd57 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 11 Jun 2024 14:49:09 +0200 Subject: [PATCH 021/323] fix(fzf): added action descriptions. (still doesnt work for trouble) --- lua/lazyvim/plugins/extras/editor/fzf.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/lazyvim/plugins/extras/editor/fzf.lua b/lua/lazyvim/plugins/extras/editor/fzf.lua index 4b519202..be6ff83b 100644 --- a/lua/lazyvim/plugins/extras/editor/fzf.lua +++ b/lua/lazyvim/plugins/extras/editor/fzf.lua @@ -39,6 +39,7 @@ return { -- Trouble config.defaults.actions.files["ctrl-t"] = require("trouble.sources.fzf").actions.open + config.set_action_helpstr(config.defaults.actions.files["ctrl-t"].fn, "Open with Trouble") -- Toggle root dir / cwd config.defaults.actions.files["ctrl-r"] = function(_, ctx) @@ -49,6 +50,7 @@ return { LazyVim.pick.open(ctx.__INFO.cmd, o) end config.defaults.actions.files["alt-c"] = config.defaults.actions.files["ctrl-r"] + config.set_action_helpstr(config.defaults.actions.files["ctrl-r"], "Toggle Root/CWD") -- use the same prompt for all local defaults = require("fzf-lua.profiles.default-title") From c6ddb2328d596771ee562f49462ae10dfc49321f Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 11 Jun 2024 14:58:35 +0200 Subject: [PATCH 022/323] fix(fzf): action desc --- lua/lazyvim/plugins/extras/editor/fzf.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/extras/editor/fzf.lua b/lua/lazyvim/plugins/extras/editor/fzf.lua index be6ff83b..a35973ec 100644 --- a/lua/lazyvim/plugins/extras/editor/fzf.lua +++ b/lua/lazyvim/plugins/extras/editor/fzf.lua @@ -37,9 +37,10 @@ return { config.defaults.keymap.builtin[""] = "preview-page-down" config.defaults.keymap.builtin[""] = "preview-page-up" + actions.open_with_trouble = require("trouble.sources.fzf").actions.open -- Trouble config.defaults.actions.files["ctrl-t"] = require("trouble.sources.fzf").actions.open - config.set_action_helpstr(config.defaults.actions.files["ctrl-t"].fn, "Open with Trouble") + config.set_action_helpstr(config.defaults.actions.files["ctrl-t"].fn, "open-with-trouble") -- Toggle root dir / cwd config.defaults.actions.files["ctrl-r"] = function(_, ctx) @@ -50,7 +51,7 @@ return { LazyVim.pick.open(ctx.__INFO.cmd, o) end config.defaults.actions.files["alt-c"] = config.defaults.actions.files["ctrl-r"] - config.set_action_helpstr(config.defaults.actions.files["ctrl-r"], "Toggle Root/CWD") + config.set_action_helpstr(config.defaults.actions.files["ctrl-r"], "toggle-root-dir") -- use the same prompt for all local defaults = require("fzf-lua.profiles.default-title") From 79b7c489fdacd0a04e7025e72e9020c4ff595eb3 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 11 Jun 2024 15:47:14 +0200 Subject: [PATCH 023/323] fix(fzf): cleanup --- lua/lazyvim/plugins/extras/editor/fzf.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/editor/fzf.lua b/lua/lazyvim/plugins/extras/editor/fzf.lua index a35973ec..ebeca0ae 100644 --- a/lua/lazyvim/plugins/extras/editor/fzf.lua +++ b/lua/lazyvim/plugins/extras/editor/fzf.lua @@ -40,7 +40,6 @@ return { actions.open_with_trouble = require("trouble.sources.fzf").actions.open -- Trouble config.defaults.actions.files["ctrl-t"] = require("trouble.sources.fzf").actions.open - config.set_action_helpstr(config.defaults.actions.files["ctrl-t"].fn, "open-with-trouble") -- Toggle root dir / cwd config.defaults.actions.files["ctrl-r"] = function(_, ctx) From 056042b221c93a14c6069d4a82b7435fc9a228fd Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 11 Jun 2024 16:08:27 +0200 Subject: [PATCH 024/323] fix(fzf): live document symbols. Fixes #3587 --- lua/lazyvim/plugins/extras/editor/fzf.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/editor/fzf.lua b/lua/lazyvim/plugins/extras/editor/fzf.lua index ebeca0ae..c8e65290 100644 --- a/lua/lazyvim/plugins/extras/editor/fzf.lua +++ b/lua/lazyvim/plugins/extras/editor/fzf.lua @@ -177,7 +177,7 @@ return { { "sS", function() - require("fzf-lua").lsp_dynamic_workspace_symbols({ + require("fzf-lua").lsp_live_workspace_symbols({ regex_filter = symbols_filter, }) end, From 7e0ac6850b613ba8cbc179fa2f71199184504a54 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 11 Jun 2024 16:11:45 +0200 Subject: [PATCH 025/323] fix(fzf): symbols filter --- lua/lazyvim/plugins/extras/editor/fzf.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/editor/fzf.lua b/lua/lazyvim/plugins/extras/editor/fzf.lua index c8e65290..2312a3e7 100644 --- a/lua/lazyvim/plugins/extras/editor/fzf.lua +++ b/lua/lazyvim/plugins/extras/editor/fzf.lua @@ -16,7 +16,12 @@ LazyVim.pick._open = function(command, opts) end local function symbols_filter(entry, ctx) - ctx.symbols_filter = ctx.symbols_filter or require("lazyvim.config").get_kind_filter(ctx.bufnr) + if ctx.symbols_filter == nil then + ctx.symbols_filter = require("lazyvim.config").get_kind_filter(ctx.bufnr) or false + end + if ctx.symbols_filter == false then + return true + end return vim.tbl_contains(ctx.symbols_filter, entry.kind) end From 7252474624cda30cac399b7f419ad25665e62a8f Mon Sep 17 00:00:00 2001 From: Adam K <105152139+akthe-at@users.noreply.github.com> Date: Tue, 11 Jun 2024 10:45:25 -0500 Subject: [PATCH 026/323] feat(copilot-chat): use fzf-lua if enabled in extras (#3590) Adds the abiltiy for fzf-lua to be used as a picker for these copilot chat actions if it was enabled in LazyExtras ## What is this PR for? This adds keybinds that exist currently for copilot-chat and Telescope but with the addition of fzf-lua as an extra, I noticed we needed the ability for the user to take advantage of them with FzfLua. ## Does this PR fix an existing issue? No ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- .../plugins/extras/coding/copilot-chat.lua | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/lua/lazyvim/plugins/extras/coding/copilot-chat.lua b/lua/lazyvim/plugins/extras/coding/copilot-chat.lua index 59f5bded..d7e33d15 100644 --- a/lua/lazyvim/plugins/extras/coding/copilot-chat.lua +++ b/lua/lazyvim/plugins/extras/coding/copilot-chat.lua @@ -100,6 +100,35 @@ return { }, }, + { + "ibhagwan/fzf-lua", + optional = true, + keys = { + -- Show help actions with fzf-lua (if installed in extras) + { + "ad", + function() + local actions = require("CopilotChat.actions") + local help = actions.help_actions() + if not help then + LazyVim.warn("No diagnostics found on the current line") + return + end + require("CopilotChat.integrations.fzflua").pick(help) + end, + desc = "Diagnostic Help (CopilotChat)", + }, + -- Show prompts actions with fzf-lua (if installed in extras) + { + "ap", + function() + local actions = require("CopilotChat.actions") + require("CopilotChat.integrations.fzflua").pick(actions.prompt_actions()) + end, + desc = "Prompt Actions (CopilotChat)", + }, + }, + }, -- Edgy integration { "folke/edgy.nvim", From a3547e4b3b03e019dbe7e543104ffd1ea82fa765 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 11 Jun 2024 19:13:46 +0200 Subject: [PATCH 027/323] revert: "fix(dap): set host to 127.0.0.1 instead of localhost to prevent issues with ipv6. Fixes #3577" This reverts commit 9b8a393edc8b9a12a39f712163f6476c084a7f71. --- lua/lazyvim/plugins/extras/lang/clangd.lua | 2 +- lua/lazyvim/plugins/extras/lang/kotlin.lua | 2 +- lua/lazyvim/plugins/extras/lang/typescript.lua | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/clangd.lua b/lua/lazyvim/plugins/extras/lang/clangd.lua index 09294970..dccbc9cb 100644 --- a/lua/lazyvim/plugins/extras/lang/clangd.lua +++ b/lua/lazyvim/plugins/extras/lang/clangd.lua @@ -123,7 +123,7 @@ return { if not dap.adapters["codelldb"] then require("dap").adapters["codelldb"] = { type = "server", - host = "127.0.0.1", + host = "localhost", port = "${port}", executable = { command = "codelldb", diff --git a/lua/lazyvim/plugins/extras/lang/kotlin.lua b/lua/lazyvim/plugins/extras/lang/kotlin.lua index 9e757722..a15f3cc4 100644 --- a/lua/lazyvim/plugins/extras/lang/kotlin.lua +++ b/lua/lazyvim/plugins/extras/lang/kotlin.lua @@ -104,7 +104,7 @@ return { port = 5005, args = {}, projectRoot = vim.fn.getcwd, - hostName = "127.0.0.1", + hostName = "localhost", timeout = 2000, }, } diff --git a/lua/lazyvim/plugins/extras/lang/typescript.lua b/lua/lazyvim/plugins/extras/lang/typescript.lua index 3015c86d..139c3086 100644 --- a/lua/lazyvim/plugins/extras/lang/typescript.lua +++ b/lua/lazyvim/plugins/extras/lang/typescript.lua @@ -194,7 +194,7 @@ return { if not dap.adapters["pwa-node"] then require("dap").adapters["pwa-node"] = { type = "server", - host = "127.0.0.1", + host = "localhost", port = "${port}", executable = { command = "node", From 9f2a3699a8f47467359f2c3defb3a711b32e0efb Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 11 Jun 2024 19:38:22 +0200 Subject: [PATCH 028/323] feat(fzf): added ctrl-u and ctrl+d to scroll in the results list --- lua/lazyvim/plugins/extras/editor/fzf.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/lazyvim/plugins/extras/editor/fzf.lua b/lua/lazyvim/plugins/extras/editor/fzf.lua index 2312a3e7..958cf7fa 100644 --- a/lua/lazyvim/plugins/extras/editor/fzf.lua +++ b/lua/lazyvim/plugins/extras/editor/fzf.lua @@ -39,6 +39,8 @@ return { -- Quickfix config.defaults.keymap.fzf["ctrl-q"] = "select-all+accept" + config.defaults.keymap.fzf["ctrl-u"] = "half-page-up" + config.defaults.keymap.fzf["ctrl-d"] = "half-page-down" config.defaults.keymap.builtin[""] = "preview-page-down" config.defaults.keymap.builtin[""] = "preview-page-up" From 1c740ce3fdb5e361ec20e5e8cca5a6a79b24ed44 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 11 Jun 2024 19:38:48 +0200 Subject: [PATCH 029/323] feat(fzf): added ctrl-x to jump with easymotion to a line, similar to flash telescope --- lua/lazyvim/plugins/extras/editor/fzf.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/extras/editor/fzf.lua b/lua/lazyvim/plugins/extras/editor/fzf.lua index 958cf7fa..0d616502 100644 --- a/lua/lazyvim/plugins/extras/editor/fzf.lua +++ b/lua/lazyvim/plugins/extras/editor/fzf.lua @@ -41,6 +41,7 @@ return { config.defaults.keymap.fzf["ctrl-q"] = "select-all+accept" config.defaults.keymap.fzf["ctrl-u"] = "half-page-up" config.defaults.keymap.fzf["ctrl-d"] = "half-page-down" + config.defaults.keymap.fzf["ctrl-x"] = "jump" config.defaults.keymap.builtin[""] = "preview-page-down" config.defaults.keymap.builtin[""] = "preview-page-up" From 0ba67c87e9054e09d562164de7ed1876587a0539 Mon Sep 17 00:00:00 2001 From: Farzad Majidfayyaz Date: Tue, 11 Jun 2024 15:06:46 -0400 Subject: [PATCH 030/323] fix(fzf): disable mini.indentscope in fzf-lua buffer (#3592) ## What is this PR for? If `fzf-lua` and `mini.indentscope` are enabled together, the indent line created by `indentscope` makes the fzf window hard and confusing to work with PS: also sorted the file list. ## Does this PR fix an existing issue? I don't think there's an existing issue for this. ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/ui/mini-indentscope.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lua/lazyvim/plugins/extras/ui/mini-indentscope.lua b/lua/lazyvim/plugins/extras/ui/mini-indentscope.lua index a7632145..1b8beeb6 100644 --- a/lua/lazyvim/plugins/extras/ui/mini-indentscope.lua +++ b/lua/lazyvim/plugins/extras/ui/mini-indentscope.lua @@ -14,17 +14,18 @@ return { init = function() vim.api.nvim_create_autocmd("FileType", { pattern = { - "help", "alpha", "dashboard", - "neo-tree", - "Trouble", - "trouble", + "fzf", + "help", "lazy", + "lazyterm", "mason", + "neo-tree", "notify", "toggleterm", - "lazyterm", + "Trouble", + "trouble", }, callback = function() vim.b.miniindentscope_disable = true From 3233385ddb61d01f87de374c061696a374596a10 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 11 Jun 2024 23:21:54 +0200 Subject: [PATCH 031/323] fix(vue): disable inlay hints for vue, since they seem broken --- lua/lazyvim/plugins/lsp/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index 371315ef..de3ecc80 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -38,7 +38,7 @@ return { -- provide the inlay hints. inlay_hints = { enabled = true, - exclude = {}, -- filetypes for which you don't want to enable inlay hints + exclude = { "vue" }, -- filetypes for which you don't want to enable inlay hints }, -- Enable this to enable the builtin LSP code lenses on Neovim >= 0.10.0 -- Be aware that you also will need to properly configure your LSP server to From 16971006c250f11d5ee3cfc974da0c34ab159286 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 11 Jun 2024 23:48:16 +0200 Subject: [PATCH 032/323] feat(fzf): use delta previewer for code actions when available --- lua/lazyvim/plugins/extras/editor/fzf.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/lazyvim/plugins/extras/editor/fzf.lua b/lua/lazyvim/plugins/extras/editor/fzf.lua index 0d616502..fbaaea8c 100644 --- a/lua/lazyvim/plugins/extras/editor/fzf.lua +++ b/lua/lazyvim/plugins/extras/editor/fzf.lua @@ -108,6 +108,9 @@ return { end, child_prefix = false, }, + code_actions = { + previewer = vim.fn.executable("delta") == 1 and "codeaction_native" or nil, + }, }, formatters = { path = { From 128c3fcfe6aded09bc319bf1ed89fa5e99dca75c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 11 Jun 2024 23:50:03 +0200 Subject: [PATCH 033/323] chore(main): release 12.13.0 (#3584) :robot: I have created a release *beep* *boop* --- ## [12.13.0](https://github.com/LazyVim/LazyVim/compare/v12.12.0...v12.13.0) (2024-06-11) ### Features * **copilot-chat:** use fzf-lua if enabled in extras ([#3590](https://github.com/LazyVim/LazyVim/issues/3590)) ([7252474](https://github.com/LazyVim/LazyVim/commit/7252474624cda30cac399b7f419ad25665e62a8f)) * **fzf:** added ctrl-u and ctrl+d to scroll in the results list ([9f2a369](https://github.com/LazyVim/LazyVim/commit/9f2a3699a8f47467359f2c3defb3a711b32e0efb)) * **fzf:** added ctrl-x to jump with easymotion to a line, similar to flash telescope ([1c740ce](https://github.com/LazyVim/LazyVim/commit/1c740ce3fdb5e361ec20e5e8cca5a6a79b24ed44)) * **fzf:** use delta previewer for code actions when available ([1697100](https://github.com/LazyVim/LazyVim/commit/16971006c250f11d5ee3cfc974da0c34ab159286)) ### Bug Fixes * **fzf:** action desc ([c6ddb23](https://github.com/LazyVim/LazyVim/commit/c6ddb2328d596771ee562f49462ae10dfc49321f)) * **fzf:** added action descriptions. (still doesnt work for trouble) ([19a6e2d](https://github.com/LazyVim/LazyVim/commit/19a6e2de158e63264aaa761228a1e3f9d615bd57)) * **fzf:** cleanup ([79b7c48](https://github.com/LazyVim/LazyVim/commit/79b7c489fdacd0a04e7025e72e9020c4ff595eb3)) * **fzf:** disable mini.indentscope in fzf-lua buffer ([#3592](https://github.com/LazyVim/LazyVim/issues/3592)) ([0ba67c8](https://github.com/LazyVim/LazyVim/commit/0ba67c87e9054e09d562164de7ed1876587a0539)) * **fzf:** live document symbols. Fixes [#3587](https://github.com/LazyVim/LazyVim/issues/3587) ([056042b](https://github.com/LazyVim/LazyVim/commit/056042b221c93a14c6069d4a82b7435fc9a228fd)) * **fzf:** symbols filter ([7e0ac68](https://github.com/LazyVim/LazyVim/commit/7e0ac6850b613ba8cbc179fa2f71199184504a54)) * **vue:** disable inlay hints for vue, since they seem broken ([3233385](https://github.com/LazyVim/LazyVim/commit/3233385ddb61d01f87de374c061696a374596a10)) ### Reverts * "fix(dap): set host to 127.0.0.1 instead of localhost to prevent issues with ipv6. Fixes [#3577](https://github.com/LazyVim/LazyVim/issues/3577)" ([a3547e4](https://github.com/LazyVim/LazyVim/commit/a3547e4b3b03e019dbe7e543104ffd1ea82fa765)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c522ed8..833330ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,31 @@ # Changelog +## [12.13.0](https://github.com/LazyVim/LazyVim/compare/v12.12.0...v12.13.0) (2024-06-11) + + +### Features + +* **copilot-chat:** use fzf-lua if enabled in extras ([#3590](https://github.com/LazyVim/LazyVim/issues/3590)) ([7252474](https://github.com/LazyVim/LazyVim/commit/7252474624cda30cac399b7f419ad25665e62a8f)) +* **fzf:** added ctrl-u and ctrl+d to scroll in the results list ([9f2a369](https://github.com/LazyVim/LazyVim/commit/9f2a3699a8f47467359f2c3defb3a711b32e0efb)) +* **fzf:** added ctrl-x to jump with easymotion to a line, similar to flash telescope ([1c740ce](https://github.com/LazyVim/LazyVim/commit/1c740ce3fdb5e361ec20e5e8cca5a6a79b24ed44)) +* **fzf:** use delta previewer for code actions when available ([1697100](https://github.com/LazyVim/LazyVim/commit/16971006c250f11d5ee3cfc974da0c34ab159286)) + + +### Bug Fixes + +* **fzf:** action desc ([c6ddb23](https://github.com/LazyVim/LazyVim/commit/c6ddb2328d596771ee562f49462ae10dfc49321f)) +* **fzf:** added action descriptions. (still doesnt work for trouble) ([19a6e2d](https://github.com/LazyVim/LazyVim/commit/19a6e2de158e63264aaa761228a1e3f9d615bd57)) +* **fzf:** cleanup ([79b7c48](https://github.com/LazyVim/LazyVim/commit/79b7c489fdacd0a04e7025e72e9020c4ff595eb3)) +* **fzf:** disable mini.indentscope in fzf-lua buffer ([#3592](https://github.com/LazyVim/LazyVim/issues/3592)) ([0ba67c8](https://github.com/LazyVim/LazyVim/commit/0ba67c87e9054e09d562164de7ed1876587a0539)) +* **fzf:** live document symbols. Fixes [#3587](https://github.com/LazyVim/LazyVim/issues/3587) ([056042b](https://github.com/LazyVim/LazyVim/commit/056042b221c93a14c6069d4a82b7435fc9a228fd)) +* **fzf:** symbols filter ([7e0ac68](https://github.com/LazyVim/LazyVim/commit/7e0ac6850b613ba8cbc179fa2f71199184504a54)) +* **vue:** disable inlay hints for vue, since they seem broken ([3233385](https://github.com/LazyVim/LazyVim/commit/3233385ddb61d01f87de374c061696a374596a10)) + + +### Reverts + +* "fix(dap): set host to 127.0.0.1 instead of localhost to prevent issues with ipv6. Fixes [#3577](https://github.com/LazyVim/LazyVim/issues/3577)" ([a3547e4](https://github.com/LazyVim/LazyVim/commit/a3547e4b3b03e019dbe7e543104ffd1ea82fa765)) + ## [12.12.0](https://github.com/LazyVim/LazyVim/compare/v12.11.0...v12.12.0) (2024-06-11) From 74cf6e446247661ccb074838f92537c96a378ff4 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 12 Jun 2024 00:27:21 +0200 Subject: [PATCH 034/323] feat(fzf): better default window size/position --- lua/lazyvim/plugins/extras/editor/fzf.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/lazyvim/plugins/extras/editor/fzf.lua b/lua/lazyvim/plugins/extras/editor/fzf.lua index fbaaea8c..0db1c1d3 100644 --- a/lua/lazyvim/plugins/extras/editor/fzf.lua +++ b/lua/lazyvim/plugins/extras/editor/fzf.lua @@ -80,6 +80,10 @@ return { ["--no-scrollbar"] = true, }, winopts = { + width = 0.8, + height = 0.8, + row = 0.5, + col = 0.5, preview = { scrollchars = { "┃", "" }, }, From ec3dba20af86187a44c953eb326725f76559cc12 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 12 Jun 2024 07:44:47 +0200 Subject: [PATCH 035/323] feat(noice): added support for fzf-lua. Closes #3596 --- lua/lazyvim/plugins/ui.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index c9bc8b6a..9d4fdda7 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -305,7 +305,7 @@ return { { "snh", function() require("noice").cmd("history") end, desc = "Noice History" }, { "sna", function() require("noice").cmd("all") end, desc = "Noice All" }, { "snd", function() require("noice").cmd("dismiss") end, desc = "Dismiss All" }, - { "snt", function() require("noice").cmd("telescope") end, desc = "Noice Telescope" }, + { "snt", function() require("noice").cmd("pick") end, desc = "Noice Picker (Telescope/FzfLua)" }, { "", function() if not require("noice.lsp").scroll(4) then return "" end end, silent = true, expr = true, desc = "Scroll Forward", mode = {"i", "n", "s"} }, { "", function() if not require("noice.lsp").scroll(-4) then return "" end end, silent = true, expr = true, desc = "Scroll Backward", mode = {"i", "n", "s"}}, }, From 60a1c1979d6e428aafd25d8a1fa3dcefbf654999 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 12 Jun 2024 05:45:25 +0000 Subject: [PATCH 036/323] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index b1dcfb85..dc1730ac 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 11 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 12 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 82f680ee6b681f9f39fbfb8431a4f362af134d1c Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 12 Jun 2024 07:57:05 +0200 Subject: [PATCH 037/323] feat(yanky): added fzf-lua support --- lua/lazyvim/plugins/extras/coding/yanky.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/coding/yanky.lua b/lua/lazyvim/plugins/extras/coding/yanky.lua index 27fa519a..8f9efdb6 100644 --- a/lua/lazyvim/plugins/extras/coding/yanky.lua +++ b/lua/lazyvim/plugins/extras/coding/yanky.lua @@ -8,8 +8,19 @@ return { highlight = { timer = 150 }, }, keys = { + { + "p", + function() + local ok, telescope = pcall(require, "telescope") + if ok then + telescope.extensions.yank_history.yank_history({}) + else + vim.cmd([[YankyRingHistory]]) + end + end, + desc = "Open Yank History", + }, -- stylua: ignore - { "p", function() require("telescope").extensions.yank_history.yank_history({ }) end, desc = "Open Yank History" }, { "y", "(YankyYank)", mode = { "n", "x" }, desc = "Yank Text" }, { "p", "(YankyPutAfter)", mode = { "n", "x" }, desc = "Put Yanked Text After Cursor" }, { "P", "(YankyPutBefore)", mode = { "n", "x" }, desc = "Put Yanked Text Before Cursor" }, From 52b572881b6fcbc805e5e584c4970c920d314f86 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 12 Jun 2024 10:43:01 +0200 Subject: [PATCH 038/323] fix(lsp): add file completion to rename file --- lua/lazyvim/util/lsp.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/util/lsp.lua b/lua/lazyvim/util/lsp.lua index 11877f1b..c01f3c94 100644 --- a/lua/lazyvim/util/lsp.lua +++ b/lua/lazyvim/util/lsp.lua @@ -129,6 +129,7 @@ function M.rename_file() vim.ui.input({ prompt = "New File Name: ", default = extra, + completion = "file", }, function(new) if not new or new == "" or new == extra then return From 14d1ca93d0e927b60fdf43424158f2336437f3a6 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 12 Jun 2024 11:23:45 +0200 Subject: [PATCH 039/323] feat(fzf): use vscode style path names formatter --- lua/lazyvim/plugins/extras/editor/fzf.lua | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/lua/lazyvim/plugins/extras/editor/fzf.lua b/lua/lazyvim/plugins/extras/editor/fzf.lua index 0db1c1d3..9aabfb9d 100644 --- a/lua/lazyvim/plugins/extras/editor/fzf.lua +++ b/lua/lazyvim/plugins/extras/editor/fzf.lua @@ -45,7 +45,6 @@ return { config.defaults.keymap.builtin[""] = "preview-page-down" config.defaults.keymap.builtin[""] = "preview-page-up" - actions.open_with_trouble = require("trouble.sources.fzf").actions.open -- Trouble config.defaults.actions.files["ctrl-t"] = require("trouble.sources.fzf").actions.open @@ -72,13 +71,14 @@ return { end fix(defaults) - vim.api.nvim_set_hl(0, "FzfLuaPath", { link = "Directory", default = true }) - return vim.tbl_deep_extend("force", opts, defaults, { fzf_colors = true, fzf_opts = { ["--no-scrollbar"] = true, }, + defaults = { + formatter = "path.filename_first", + }, winopts = { width = 0.8, height = 0.8, @@ -96,7 +96,6 @@ return { }, }, grep = { - formatter = "path.hl", actions = { ["alt-i"] = { actions.toggle_ignore }, ["alt-h"] = { actions.toggle_hidden }, @@ -116,21 +115,6 @@ return { previewer = vim.fn.executable("delta") == 1 and "codeaction_native" or nil, }, }, - formatters = { - path = { - hl = { - _to = function() - local _, escseq = require("fzf-lua.utils").ansi_from_hl("FzfLuaPath", "foo") - return [[ - return function(s, _, m) - return "]] .. (escseq or "") .. [[" - .. s .. m.utils.ansi_escseq.clear - end - ]] - end, - }, - }, - }, }) end, keys = { From 5c876b754999eb5fe8b79c5b6f5249b5bbddb454 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 12 Jun 2024 11:31:25 +0200 Subject: [PATCH 040/323] feat(fzf): disable dressing in favor of noice (vim.ui.input) and fzf-lua (vim.ui.select) --- lua/lazyvim/plugins/extras/editor/fzf.lua | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/lua/lazyvim/plugins/extras/editor/fzf.lua b/lua/lazyvim/plugins/extras/editor/fzf.lua index 9aabfb9d..58ec7695 100644 --- a/lua/lazyvim/plugins/extras/editor/fzf.lua +++ b/lua/lazyvim/plugins/extras/editor/fzf.lua @@ -26,6 +26,7 @@ local function symbols_filter(entry, ctx) end return { + { "stevearc/dressing.nvim", enabled = false }, { "nvim-telescope/telescope.nvim", enabled = false, @@ -79,6 +80,23 @@ return { defaults = { formatter = "path.filename_first", }, + -- Custom LazyVim option to configure vim.ui.select + ui_select = function(fzf_opts, items) + local title = vim.trim((fzf_opts.prompt or "Select"):gsub("%s*:%s*$", "")) + local width, height ---@type number?, number? + if fzf_opts.kind ~= "codeaction" then + width, height = 0.5, math.floor(math.min(vim.o.lines * 0.8, #items + 2) + 0.5) + end + return vim.tbl_deep_extend("force", fzf_opts, { + prompt = " ", + winopts = { + title = " " .. title .. " ", + title_pos = "center", + width = width, + height = height, + }, + }) + end, winopts = { width = 0.8, height = 0.8, @@ -117,6 +135,10 @@ return { }, }) end, + config = function(_, opts) + require("fzf-lua").setup(opts) + require("fzf-lua").register_ui_select(opts.ui_select or nil) + end, keys = { { "", "close", ft = "fzf", mode = "t", nowait = true }, { "", "", ft = "fzf", mode = "t", nowait = true }, From 46eb3242d36a4196a5e6f3fc4ec8f0dd820915cc Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 12 Jun 2024 11:41:03 +0200 Subject: [PATCH 041/323] refactor: copilot-chat --- .../plugins/extras/coding/copilot-chat.lua | 82 +++++-------------- 1 file changed, 20 insertions(+), 62 deletions(-) diff --git a/lua/lazyvim/plugins/extras/coding/copilot-chat.lua b/lua/lazyvim/plugins/extras/coding/copilot-chat.lua index d7e33d15..2db98a8c 100644 --- a/lua/lazyvim/plugins/extras/coding/copilot-chat.lua +++ b/lua/lazyvim/plugins/extras/coding/copilot-chat.lua @@ -1,3 +1,19 @@ +local M = {} + +---@param kind string +function M.pick(kind) + return function() + local actions = require("CopilotChat.actions") + local items = actions[kind .. "_actions"]() + if not items then + LazyVim.warn("No " .. kind .. " found on the current line") + return + end + local ok = pcall(require, "fzf-lua") + require("CopilotChat.integrations." .. (ok and "fzflua" or "telescope")).pick(items) + end +end + return { { "CopilotC-Nvim/CopilotChat.nvim", @@ -50,6 +66,10 @@ return { desc = "Quick Chat (CopilotChat)", mode = { "n", "v" }, }, + -- Show help actions with telescope + { "ad", M.pick("help"), desc = "Diagnostic Help (CopilotChat)", mode = { "n", "v" } }, + -- Show prompts actions with telescope + { "ap", M.pick("prompt"), desc = "Prompt Actions (CopilotChat)", mode = { "n", "v" } }, }, config = function(_, opts) local chat = require("CopilotChat") @@ -67,68 +87,6 @@ return { end, }, - -- Telescope integration - { - "nvim-telescope/telescope.nvim", - optional = true, - keys = { - -- Show help actions with telescope - { - "ad", - function() - local actions = require("CopilotChat.actions") - local help = actions.help_actions() - if not help then - LazyVim.warn("No diagnostics found on the current line") - return - end - require("CopilotChat.integrations.telescope").pick(help) - end, - desc = "Diagnostic Help (CopilotChat)", - mode = { "n", "v" }, - }, - -- Show prompts actions with telescope - { - "ap", - function() - local actions = require("CopilotChat.actions") - require("CopilotChat.integrations.telescope").pick(actions.prompt_actions()) - end, - desc = "Prompt Actions (CopilotChat)", - mode = { "n", "v" }, - }, - }, - }, - - { - "ibhagwan/fzf-lua", - optional = true, - keys = { - -- Show help actions with fzf-lua (if installed in extras) - { - "ad", - function() - local actions = require("CopilotChat.actions") - local help = actions.help_actions() - if not help then - LazyVim.warn("No diagnostics found on the current line") - return - end - require("CopilotChat.integrations.fzflua").pick(help) - end, - desc = "Diagnostic Help (CopilotChat)", - }, - -- Show prompts actions with fzf-lua (if installed in extras) - { - "ap", - function() - local actions = require("CopilotChat.actions") - require("CopilotChat.integrations.fzflua").pick(actions.prompt_actions()) - end, - desc = "Prompt Actions (CopilotChat)", - }, - }, - }, -- Edgy integration { "folke/edgy.nvim", From 4b9e4edbb115f1f13906b2cdb68986e336b05729 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 12 Jun 2024 18:18:17 +0200 Subject: [PATCH 042/323] fix(project): add fzf-lua integration. Fixes #3609 --- lua/lazyvim/plugins/extras/util/project.lua | 70 ++++++++++++++------- 1 file changed, 49 insertions(+), 21 deletions(-) diff --git a/lua/lazyvim/plugins/extras/util/project.lua b/lua/lazyvim/plugins/extras/util/project.lua index 16e72077..fc74929b 100644 --- a/lua/lazyvim/plugins/extras/util/project.lua +++ b/lua/lazyvim/plugins/extras/util/project.lua @@ -1,24 +1,50 @@ +local pick = function() + if pcall(require, "telescope") then + return vim.cmd("Telescope projects") + end + + local fzf_lua = require("fzf-lua") + local history = require("project_nvim.utils.history") + local results = history.get_recent_projects() + fzf_lua.fzf_exec(results, { + actions = { + ["default"] = { + function(selected) + fzf_lua.files({ cwd = selected[1] }) + end, + }, + }, + }) +end + return { + { + "ahmedkhalf/project.nvim", + opts = { + manual_mode = true, + }, + event = "VeryLazy", + config = function(_, opts) + require("project_nvim").setup(opts) + LazyVim.on_load("telescope.nvim", function() + require("telescope").load_extension("projects") + end) + end, + }, + { "telescope.nvim", - dependencies = { - -- project management - { - "ahmedkhalf/project.nvim", - opts = { - manual_mode = true, - }, - event = "VeryLazy", - config = function(_, opts) - require("project_nvim").setup(opts) - LazyVim.on_load("telescope.nvim", function() - require("telescope").load_extension("projects") - end) - end, - keys = { - { "fp", "Telescope projects", desc = "Projects" }, - }, - }, + optional = true, + keys = { + { "fp", pick, desc = "Projects" }, + }, + }, + + { + "ibhagwan/fzf-lua", + optional = true, + keys = { + { "fp", pick, desc = "Projects" }, }, }, @@ -26,12 +52,13 @@ return { "goolord/alpha-nvim", optional = true, opts = function(_, dashboard) - local button = dashboard.button("p", " " .. " Projects", ":Telescope projects ") + local button = dashboard.button("p", " " .. " Projects", pick) button.opts.hl = "AlphaButtons" button.opts.hl_shortcut = "AlphaShortcut" table.insert(dashboard.section.buttons.val, 4, button) end, }, + { "echasnovski/mini.starter", optional = true, @@ -39,19 +66,20 @@ return { local items = { { name = "Projects", - action = "Telescope projects", + action = pick, section = string.rep(" ", 22) .. "Telescope", }, } vim.list_extend(opts.items, items) end, }, + { "nvimdev/dashboard-nvim", optional = true, opts = function(_, opts) local projects = { - action = "Telescope projects", + action = pick, desc = " Projects", icon = " ", key = "p", From d82c11f889b03effa5248170ac1b4b4681391f08 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 12 Jun 2024 20:55:51 +0200 Subject: [PATCH 043/323] fix(project): telescope name --- lua/lazyvim/plugins/extras/util/project.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/util/project.lua b/lua/lazyvim/plugins/extras/util/project.lua index fc74929b..c7c7cebc 100644 --- a/lua/lazyvim/plugins/extras/util/project.lua +++ b/lua/lazyvim/plugins/extras/util/project.lua @@ -33,7 +33,7 @@ return { }, { - "telescope.nvim", + "nvim-telescope/telescope.nvim", optional = true, keys = { { "fp", pick, desc = "Projects" }, From 39a908c9faca2387c5444de89191275b7bd02576 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 13 Jun 2024 06:07:02 +0200 Subject: [PATCH 044/323] feat(pick): move pickers to extras (telescope still the default) (#3606) ## What is this PR for? Refactoring of pickers in LazyVim: - [x] telescope moved to extras - [x] dressing was moved to the telescope extra. Not needed with fzf-lua and noice - [x] when none of the two is enabled, then telescope will be enabled - [x] when using `:LazyExtras` to enable fzf-lua, the telescope spec will never be parsed - [x] when not using `:LazyExras`, the spec will be parsed, but one of the two will be disabled. - [x] only one picker extra can be used to prevent issues - [ ] cleanup lsp keymaps --- lua/lazyvim/plugins/editor.lua | 195 +------------- lua/lazyvim/plugins/extras/coding/yanky.lua | 5 +- lua/lazyvim/plugins/extras/editor/fzf.lua | 39 +-- .../plugins/extras/editor/telescope.lua | 245 ++++++++++++++++++ lua/lazyvim/plugins/extras/lang/terraform.lua | 1 + lua/lazyvim/plugins/extras/util/project.lua | 28 +- lua/lazyvim/plugins/ui.lua | 18 -- lua/lazyvim/util/init.lua | 3 + lua/lazyvim/util/pick.lua | 33 ++- lua/lazyvim/util/telescope.lua | 48 ---- 10 files changed, 331 insertions(+), 284 deletions(-) create mode 100644 lua/lazyvim/plugins/extras/editor/telescope.lua delete mode 100644 lua/lazyvim/util/telescope.lua diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index c41a5db7..f3f9da7b 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -142,156 +142,6 @@ return { }, }, - -- Fuzzy finder. - -- The default key bindings to find files will use Telescope's - -- `find_files` or `git_files` depending on whether the - -- directory is a git repo. - { - "nvim-telescope/telescope.nvim", - cmd = "Telescope", - version = false, -- telescope did only one release, so use HEAD for now - dependencies = { - { - "nvim-telescope/telescope-fzf-native.nvim", - build = have_make and "make" - or "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build", - enabled = have_make or have_cmake, - config = function(plugin) - LazyVim.on_load("telescope.nvim", function() - local ok, err = pcall(require("telescope").load_extension, "fzf") - if not ok then - local lib = plugin.dir .. "/build/libfzf." .. (LazyVim.is_win() and "dll" or "so") - if not vim.uv.fs_stat(lib) then - LazyVim.warn("`telescope-fzf-native.nvim` not built. Rebuilding...") - require("lazy").build({ plugins = { plugin }, show = false }):wait(function() - LazyVim.info("Rebuilding `telescope-fzf-native.nvim` done.\nPlease restart Neovim.") - end) - else - LazyVim.error("Failed to load `telescope-fzf-native.nvim`:\n" .. err) - end - end - end) - end, - }, - }, - keys = { - { - ",", - "Telescope buffers sort_mru=true sort_lastused=true", - desc = "Switch Buffer", - }, - { "/", LazyVim.pick("live_grep"), desc = "Grep (Root Dir)" }, - { ":", "Telescope command_history", desc = "Command History" }, - { "", LazyVim.pick("auto"), desc = "Find Files (Root Dir)" }, - -- find - { "fb", "Telescope buffers sort_mru=true sort_lastused=true", desc = "Buffers" }, - { "fc", LazyVim.pick.config_files(), desc = "Find Config File" }, - { "ff", LazyVim.pick("auto"), desc = "Find Files (Root Dir)" }, - { "fF", LazyVim.pick("auto", { root = false }), desc = "Find Files (cwd)" }, - { "fg", "Telescope git_files", desc = "Find Files (git-files)" }, - { "fr", "Telescope oldfiles", desc = "Recent" }, - { "fR", LazyVim.pick("oldfiles", { cwd = vim.uv.cwd() }), desc = "Recent (cwd)" }, - -- git - { "gc", "Telescope git_commits", desc = "Commits" }, - { "gs", "Telescope git_status", desc = "Status" }, - -- search - { 's"', "Telescope registers", desc = "Registers" }, - { "sa", "Telescope autocommands", desc = "Auto Commands" }, - { "sb", "Telescope current_buffer_fuzzy_find", desc = "Buffer" }, - { "sc", "Telescope command_history", desc = "Command History" }, - { "sC", "Telescope commands", desc = "Commands" }, - { "sd", "Telescope diagnostics bufnr=0", desc = "Document Diagnostics" }, - { "sD", "Telescope diagnostics", desc = "Workspace Diagnostics" }, - { "sg", LazyVim.pick("live_grep"), desc = "Grep (Root Dir)" }, - { "sG", LazyVim.pick("live_grep", { root = false }), desc = "Grep (cwd)" }, - { "sh", "Telescope help_tags", desc = "Help Pages" }, - { "sH", "Telescope highlights", desc = "Search Highlight Groups" }, - { "sj", "Telescope jumplist", desc = "Jumplist" }, - { "sk", "Telescope keymaps", desc = "Key Maps" }, - { "sl", "Telescope loclist", desc = "Location List" }, - { "sM", "Telescope man_pages", desc = "Man Pages" }, - { "sm", "Telescope marks", desc = "Jump to Mark" }, - { "so", "Telescope vim_options", desc = "Options" }, - { "sR", "Telescope resume", desc = "Resume" }, - { "sq", "Telescope quickfix", desc = "Quickfix List" }, - { "sw", LazyVim.pick("grep_string", { word_match = "-w" }), desc = "Word (Root Dir)" }, - { "sW", LazyVim.pick("grep_string", { root = false, word_match = "-w" }), desc = "Word (cwd)" }, - { "sw", LazyVim.pick("grep_string"), mode = "v", desc = "Selection (Root Dir)" }, - { "sW", LazyVim.pick("grep_string", { root = false }), mode = "v", desc = "Selection (cwd)" }, - { "uC", LazyVim.pick("colorscheme", { enable_preview = true }), desc = "Colorscheme with Preview" }, - { - "ss", - function() - require("telescope.builtin").lsp_document_symbols({ - symbols = require("lazyvim.config").get_kind_filter(), - }) - end, - desc = "Goto Symbol", - }, - { - "sS", - function() - require("telescope.builtin").lsp_dynamic_workspace_symbols({ - symbols = require("lazyvim.config").get_kind_filter(), - }) - end, - desc = "Goto Symbol (Workspace)", - }, - }, - opts = function() - local actions = require("telescope.actions") - - local open_with_trouble = function(...) - return require("trouble.sources.telescope").open(...) - end - local find_files_no_ignore = function() - local action_state = require("telescope.actions.state") - local line = action_state.get_current_line() - LazyVim.pick("find_files", { no_ignore = true, default_text = line })() - end - local find_files_with_hidden = function() - local action_state = require("telescope.actions.state") - local line = action_state.get_current_line() - LazyVim.pick("find_files", { hidden = true, default_text = line })() - end - - return { - defaults = { - prompt_prefix = " ", - selection_caret = " ", - -- open files in the first window that is an actual file. - -- use the current window if no other window is available. - get_selection_window = function() - local wins = vim.api.nvim_list_wins() - table.insert(wins, 1, vim.api.nvim_get_current_win()) - for _, win in ipairs(wins) do - local buf = vim.api.nvim_win_get_buf(win) - if vim.bo[buf].buftype == "" then - return win - end - end - return 0 - end, - mappings = { - i = { - [""] = open_with_trouble, - [""] = open_with_trouble, - [""] = find_files_no_ignore, - [""] = find_files_with_hidden, - [""] = actions.cycle_history_next, - [""] = actions.cycle_history_prev, - [""] = actions.preview_scrolling_down, - [""] = actions.preview_scrolling_up, - }, - n = { - ["q"] = actions.close, - }, - }, - }, - } - end, - }, - -- Flash enhances the built-in search functionality by showing labels -- at the end of each match, letting you quickly jump to a specific -- location. @@ -311,38 +161,6 @@ return { }, }, - -- Flash Telescope config - { - "nvim-telescope/telescope.nvim", - optional = true, - opts = function(_, opts) - if not LazyVim.has("flash.nvim") then - return - end - local function flash(prompt_bufnr) - require("flash").jump({ - pattern = "^", - label = { after = { 0, 0 } }, - search = { - mode = "search", - exclude = { - function(win) - return vim.bo[vim.api.nvim_win_get_buf(win)].filetype ~= "TelescopeResults" - end, - }, - }, - action = function(match) - local picker = require("telescope.actions.state").get_current_picker(prompt_bufnr) - picker:set_selection(match.pos[1] - 1) - end, - }) - end - opts.defaults = vim.tbl_deep_extend("force", opts.defaults or {}, { - mappings = { n = { s = flash }, i = { [""] = flash } }, - }) - end, - }, - -- which-key helps you remember key bindings by showing a popup -- with the active keybindings of the command you started typing. { @@ -482,4 +300,17 @@ return { { "sT", "TodoTelescope keywords=TODO,FIX,FIXME", desc = "Todo/Fix/Fixme" }, }, }, + + { + import = "lazyvim.plugins.extras.editor.fzf", + enabled = function() + return LazyVim.has_extra("editor.fzf") + end, + }, + { + import = "lazyvim.plugins.extras.editor.telescope", + enabled = function() + return not LazyVim.has_extra("editor.fzf") + end, + }, } diff --git a/lua/lazyvim/plugins/extras/coding/yanky.lua b/lua/lazyvim/plugins/extras/coding/yanky.lua index 8f9efdb6..02b3b18a 100644 --- a/lua/lazyvim/plugins/extras/coding/yanky.lua +++ b/lua/lazyvim/plugins/extras/coding/yanky.lua @@ -11,9 +11,8 @@ return { { "p", function() - local ok, telescope = pcall(require, "telescope") - if ok then - telescope.extensions.yank_history.yank_history({}) + if LazyVim.pick.picker.name == "telescope" then + require("telescope").extensions.yank_history.yank_history({}) else vim.cmd([[YankyRingHistory]]) end diff --git a/lua/lazyvim/plugins/extras/editor/fzf.lua b/lua/lazyvim/plugins/extras/editor/fzf.lua index 58ec7695..2a5f28c4 100644 --- a/lua/lazyvim/plugins/extras/editor/fzf.lua +++ b/lua/lazyvim/plugins/extras/editor/fzf.lua @@ -1,18 +1,25 @@ ---@class FzfLuaOpts: lazyvim.util.pick.Opts ---@field cmd string? -LazyVim.pick.commands = { - files = "files", -} +---@type LazyPicker +local picker = { + name = "fzf", + commands = { + files = "files", + }, ----@param command string ----@param opts? FzfLuaOpts -LazyVim.pick._open = function(command, opts) - opts = opts or {} - if opts.cmd == nil and command == "git_files" and opts.show_untracked then - opts.cmd = "git ls-files --exclude-standard --cached --others" - end - return require("fzf-lua")[command](opts) + ---@param command string + ---@param opts? FzfLuaOpts + open = function(command, opts) + opts = opts or {} + if opts.cmd == nil and command == "git_files" and opts.show_untracked then + opts.cmd = "git ls-files --exclude-standard --cached --others" + end + return require("fzf-lua")[command](opts) + end, +} +if not LazyVim.pick.register(picker) then + return {} end local function symbols_filter(entry, ctx) @@ -26,11 +33,8 @@ local function symbols_filter(entry, ctx) end return { - { "stevearc/dressing.nvim", enabled = false }, - { - "nvim-telescope/telescope.nvim", - enabled = false, - }, + desc = "Awesome picker for FZF (alternative to Telescope)", + recommended = true, { "ibhagwan/fzf-lua", event = "VeryLazy", @@ -78,7 +82,8 @@ return { ["--no-scrollbar"] = true, }, defaults = { - formatter = "path.filename_first", + -- formatter = "path.filename_first", + formatter = "path.dirname_first", }, -- Custom LazyVim option to configure vim.ui.select ui_select = function(fzf_opts, items) diff --git a/lua/lazyvim/plugins/extras/editor/telescope.lua b/lua/lazyvim/plugins/extras/editor/telescope.lua new file mode 100644 index 00000000..7bbe4c16 --- /dev/null +++ b/lua/lazyvim/plugins/extras/editor/telescope.lua @@ -0,0 +1,245 @@ +-- TODO: +-- - [ ] remove telescope util +-- - [ ] better lsp bindings + +---@type LazyPicker +local picker = { + name = "telescope", + commands = { + files = "find_files", + }, + -- this will return a function that calls telescope. + -- cwd will default to lazyvim.util.get_root + -- for `files`, git_files or find_files will be chosen depending on .git + ---@param builtin string + ---@param opts? lazyvim.util.pick.Opts + open = function(builtin, opts) + opts = opts or {} + if opts.cwd and opts.cwd ~= vim.uv.cwd() then + local function open_cwd_dir() + local action_state = require("telescope.actions.state") + local line = action_state.get_current_line() + LazyVim.pick.open( + builtin, + vim.tbl_deep_extend("force", {}, opts or {}, { + root = false, + default_text = line, + }) + ) + end + ---@diagnostic disable-next-line: inject-field + opts.attach_mappings = function(_, map) + -- opts.desc is overridden by telescope, until it's changed there is this fix + map("i", "", open_cwd_dir, { desc = "Open cwd Directory" }) + return true + end + end + + require("telescope.builtin")[builtin](opts) + end, +} +if not LazyVim.pick.register(picker) then + return {} +end + +return { + -- Fuzzy finder. + -- The default key bindings to find files will use Telescope's + -- `find_files` or `git_files` depending on whether the + -- directory is a git repo. + { + "nvim-telescope/telescope.nvim", + cmd = "Telescope", + version = false, -- telescope did only one release, so use HEAD for now + dependencies = { + { + "nvim-telescope/telescope-fzf-native.nvim", + build = have_make and "make" + or "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build", + enabled = have_make or have_cmake, + config = function(plugin) + LazyVim.on_load("telescope.nvim", function() + local ok, err = pcall(require("telescope").load_extension, "fzf") + if not ok then + local lib = plugin.dir .. "/build/libfzf." .. (LazyVim.is_win() and "dll" or "so") + if not vim.uv.fs_stat(lib) then + LazyVim.warn("`telescope-fzf-native.nvim` not built. Rebuilding...") + require("lazy").build({ plugins = { plugin }, show = false }):wait(function() + LazyVim.info("Rebuilding `telescope-fzf-native.nvim` done.\nPlease restart Neovim.") + end) + else + LazyVim.error("Failed to load `telescope-fzf-native.nvim`:\n" .. err) + end + end + end) + end, + }, + }, + keys = { + { + ",", + "Telescope buffers sort_mru=true sort_lastused=true", + desc = "Switch Buffer", + }, + { "/", LazyVim.pick("live_grep"), desc = "Grep (Root Dir)" }, + { ":", "Telescope command_history", desc = "Command History" }, + { "", LazyVim.pick("auto"), desc = "Find Files (Root Dir)" }, + -- find + { "fb", "Telescope buffers sort_mru=true sort_lastused=true", desc = "Buffers" }, + { "fc", LazyVim.pick.config_files(), desc = "Find Config File" }, + { "ff", LazyVim.pick("auto"), desc = "Find Files (Root Dir)" }, + { "fF", LazyVim.pick("auto", { root = false }), desc = "Find Files (cwd)" }, + { "fg", "Telescope git_files", desc = "Find Files (git-files)" }, + { "fr", "Telescope oldfiles", desc = "Recent" }, + { "fR", LazyVim.pick("oldfiles", { cwd = vim.uv.cwd() }), desc = "Recent (cwd)" }, + -- git + { "gc", "Telescope git_commits", desc = "Commits" }, + { "gs", "Telescope git_status", desc = "Status" }, + -- search + { 's"', "Telescope registers", desc = "Registers" }, + { "sa", "Telescope autocommands", desc = "Auto Commands" }, + { "sb", "Telescope current_buffer_fuzzy_find", desc = "Buffer" }, + { "sc", "Telescope command_history", desc = "Command History" }, + { "sC", "Telescope commands", desc = "Commands" }, + { "sd", "Telescope diagnostics bufnr=0", desc = "Document Diagnostics" }, + { "sD", "Telescope diagnostics", desc = "Workspace Diagnostics" }, + { "sg", LazyVim.pick("live_grep"), desc = "Grep (Root Dir)" }, + { "sG", LazyVim.pick("live_grep", { root = false }), desc = "Grep (cwd)" }, + { "sh", "Telescope help_tags", desc = "Help Pages" }, + { "sH", "Telescope highlights", desc = "Search Highlight Groups" }, + { "sj", "Telescope jumplist", desc = "Jumplist" }, + { "sk", "Telescope keymaps", desc = "Key Maps" }, + { "sl", "Telescope loclist", desc = "Location List" }, + { "sM", "Telescope man_pages", desc = "Man Pages" }, + { "sm", "Telescope marks", desc = "Jump to Mark" }, + { "so", "Telescope vim_options", desc = "Options" }, + { "sR", "Telescope resume", desc = "Resume" }, + { "sq", "Telescope quickfix", desc = "Quickfix List" }, + { "sw", LazyVim.pick("grep_string", { word_match = "-w" }), desc = "Word (Root Dir)" }, + { "sW", LazyVim.pick("grep_string", { root = false, word_match = "-w" }), desc = "Word (cwd)" }, + { "sw", LazyVim.pick("grep_string"), mode = "v", desc = "Selection (Root Dir)" }, + { "sW", LazyVim.pick("grep_string", { root = false }), mode = "v", desc = "Selection (cwd)" }, + { "uC", LazyVim.pick("colorscheme", { enable_preview = true }), desc = "Colorscheme with Preview" }, + { + "ss", + function() + require("telescope.builtin").lsp_document_symbols({ + symbols = require("lazyvim.config").get_kind_filter(), + }) + end, + desc = "Goto Symbol", + }, + { + "sS", + function() + require("telescope.builtin").lsp_dynamic_workspace_symbols({ + symbols = require("lazyvim.config").get_kind_filter(), + }) + end, + desc = "Goto Symbol (Workspace)", + }, + }, + opts = function() + local actions = require("telescope.actions") + + local open_with_trouble = function(...) + return require("trouble.sources.telescope").open(...) + end + local find_files_no_ignore = function() + local action_state = require("telescope.actions.state") + local line = action_state.get_current_line() + LazyVim.pick("find_files", { no_ignore = true, default_text = line })() + end + local find_files_with_hidden = function() + local action_state = require("telescope.actions.state") + local line = action_state.get_current_line() + LazyVim.pick("find_files", { hidden = true, default_text = line })() + end + + return { + defaults = { + prompt_prefix = " ", + selection_caret = " ", + -- open files in the first window that is an actual file. + -- use the current window if no other window is available. + get_selection_window = function() + local wins = vim.api.nvim_list_wins() + table.insert(wins, 1, vim.api.nvim_get_current_win()) + for _, win in ipairs(wins) do + local buf = vim.api.nvim_win_get_buf(win) + if vim.bo[buf].buftype == "" then + return win + end + end + return 0 + end, + mappings = { + i = { + [""] = open_with_trouble, + [""] = open_with_trouble, + [""] = find_files_no_ignore, + [""] = find_files_with_hidden, + [""] = actions.cycle_history_next, + [""] = actions.cycle_history_prev, + [""] = actions.preview_scrolling_down, + [""] = actions.preview_scrolling_up, + }, + n = { + ["q"] = actions.close, + }, + }, + }, + } + end, + }, + + -- Flash Telescope config + { + "nvim-telescope/telescope.nvim", + optional = true, + opts = function(_, opts) + if not LazyVim.has("flash.nvim") then + return + end + local function flash(prompt_bufnr) + require("flash").jump({ + pattern = "^", + label = { after = { 0, 0 } }, + search = { + mode = "search", + exclude = { + function(win) + return vim.bo[vim.api.nvim_win_get_buf(win)].filetype ~= "TelescopeResults" + end, + }, + }, + action = function(match) + local picker = require("telescope.actions.state").get_current_picker(prompt_bufnr) + picker:set_selection(match.pos[1] - 1) + end, + }) + end + opts.defaults = vim.tbl_deep_extend("force", opts.defaults or {}, { + mappings = { n = { s = flash }, i = { [""] = flash } }, + }) + end, + }, + + -- better vim.ui with telescope + { + "stevearc/dressing.nvim", + lazy = true, + init = function() + ---@diagnostic disable-next-line: duplicate-set-field + vim.ui.select = function(...) + require("lazy").load({ plugins = { "dressing.nvim" } }) + return vim.ui.select(...) + end + ---@diagnostic disable-next-line: duplicate-set-field + vim.ui.input = function(...) + require("lazy").load({ plugins = { "dressing.nvim" } }) + return vim.ui.input(...) + end + end, + }, +} diff --git a/lua/lazyvim/plugins/extras/lang/terraform.lua b/lua/lazyvim/plugins/extras/lang/terraform.lua index 33c7c61c..5ab58f86 100644 --- a/lua/lazyvim/plugins/extras/lang/terraform.lua +++ b/lua/lazyvim/plugins/extras/lang/terraform.lua @@ -57,6 +57,7 @@ return { }, { "nvim-telescope/telescope.nvim", + optional = true, dependencies = { { "ANGkeith/telescope-terraform-doc.nvim", diff --git a/lua/lazyvim/plugins/extras/util/project.lua b/lua/lazyvim/plugins/extras/util/project.lua index c7c7cebc..395946fd 100644 --- a/lua/lazyvim/plugins/extras/util/project.lua +++ b/lua/lazyvim/plugins/extras/util/project.lua @@ -1,20 +1,20 @@ local pick = function() - if pcall(require, "telescope") then + if LazyVim.pick.picker.name == "telescope" then return vim.cmd("Telescope projects") - end - - local fzf_lua = require("fzf-lua") - local history = require("project_nvim.utils.history") - local results = history.get_recent_projects() - fzf_lua.fzf_exec(results, { - actions = { - ["default"] = { - function(selected) - fzf_lua.files({ cwd = selected[1] }) - end, + elseif LazyVim.pick.picker.name == "fzf" then + local fzf_lua = require("fzf-lua") + local history = require("project_nvim.utils.history") + local results = history.get_recent_projects() + fzf_lua.fzf_exec(results, { + actions = { + ["default"] = { + function(selected) + fzf_lua.files({ cwd = selected[1] }) + end, + }, }, - }, - }) + }) + end end return { diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index 9d4fdda7..744585c0 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -34,24 +34,6 @@ return { end, }, - -- better vim.ui - { - "stevearc/dressing.nvim", - lazy = true, - init = function() - ---@diagnostic disable-next-line: duplicate-set-field - vim.ui.select = function(...) - require("lazy").load({ plugins = { "dressing.nvim" } }) - return vim.ui.select(...) - end - ---@diagnostic disable-next-line: duplicate-set-field - vim.ui.input = function(...) - require("lazy").load({ plugins = { "dressing.nvim" } }) - return vim.ui.input(...) - end - end, - }, - -- This is what powers LazyVim's fancy-looking -- tabs, which include filetype icons and close buttons. { diff --git a/lua/lazyvim/util/init.lua b/lua/lazyvim/util/init.lua index 4a1478e6..212d6ae6 100644 --- a/lua/lazyvim/util/init.lua +++ b/lua/lazyvim/util/init.lua @@ -32,6 +32,7 @@ local deprecated = { toggle_diagnostics = { "toggle", "diagnostics" }, toggle_number = { "toggle", "number" }, fg = "ui", + telescope = "pick", } setmetatable(M, { @@ -78,8 +79,10 @@ end ---@param extra string function M.has_extra(extra) + local Config = require("lazyvim.config") local modname = "lazyvim.plugins.extras." .. extra return vim.tbl_contains(require("lazy.core.config").spec.modules, modname) + or vim.tbl_contains(Config.json.data.extras, modname) end ---@param fn fun() diff --git a/lua/lazyvim/util/pick.lua b/lua/lazyvim/util/pick.lua index 30160215..b8e4a94b 100644 --- a/lua/lazyvim/util/pick.lua +++ b/lua/lazyvim/util/pick.lua @@ -12,14 +12,43 @@ local M = setmetatable({}, { ---@field buf? number ---@field show_untracked? boolean +---@class LazyPicker +---@field name string +---@field open fun(command:string, opts?:lazyvim.util.pick.Opts) +---@field commands table + +---@type LazyPicker? +M.picker = nil + ---@type table M.commands = { files = "find_files", } +---@param picker LazyPicker +function M.register(picker) + -- this only happens when using :LazyExtras + -- so allow to get the full spec + if vim.v.vim_did_enter == 1 then + return true + end + if M.picker then + LazyVim.warn( + "`LazyVim.pick`: picker already set to `" .. M.picker.name .. "`,\nignoring new picker `" .. picker.name .. "`" + ) + return false + end + M.picker = picker + return true +end + ---@param command? string ---@param opts? lazyvim.util.pick.Opts function M.open(command, opts) + if not M.picker then + return LazyVim.error("LazyVim.pick: picker not set") + end + command = command or "auto" opts = opts or {} @@ -46,8 +75,8 @@ function M.open(command, opts) opts.show_untracked = opts.show_untracked ~= false end end - command = M.commands[command] or command - M._open(command, opts) + command = M.picker.commands[command] or command + M.picker.open(command, opts) end ---@param command? string diff --git a/lua/lazyvim/util/telescope.lua b/lua/lazyvim/util/telescope.lua deleted file mode 100644 index b6414d2c..00000000 --- a/lua/lazyvim/util/telescope.lua +++ /dev/null @@ -1,48 +0,0 @@ ----@class lazyvim.util.telescope ----@overload fun(builtin:string, opts?:lazyvim.util.pick.Opts) -local M = setmetatable({}, { - __call = function(m, ...) - return m.telescope(...) - end, -}) - --- this will return a function that calls telescope. --- cwd will default to lazyvim.util.get_root --- for `files`, git_files or find_files will be chosen depending on .git ----@param builtin string ----@param opts? lazyvim.util.pick.Opts -function M.open(builtin, opts) - opts = opts or {} - if opts.cwd and opts.cwd ~= vim.uv.cwd() then - local function open_cwd_dir() - local action_state = require("telescope.actions.state") - local line = action_state.get_current_line() - LazyVim.pick.open( - builtin, - vim.tbl_deep_extend("force", {}, opts or {}, { - root = false, - default_text = line, - }) - ) - end - ---@diagnostic disable-next-line: inject-field - opts.attach_mappings = function(_, map) - -- opts.desc is overridden by telescope, until it's changed there is this fix - map("i", "", open_cwd_dir, { desc = "Open cwd Directory" }) - return true - end - end - - require("telescope.builtin")[builtin](opts) -end - -M.telescope = function(...) - LazyVim.deprecate("LazyVim.telescope", "LazyVim.pick") - return LazyVim.pick.wrap(...) -end - -function M.config_files() - return LazyVim.pick.config_files() -end - -return M From caf8f114d96f1198dd6b5a6383f3fde7c0aa6c53 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 13 Jun 2024 04:07:37 +0000 Subject: [PATCH 045/323] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index dc1730ac..f95204b9 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 12 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 13 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 339979d3143d46a37c304d45a00c7a4f448e707d Mon Sep 17 00:00:00 2001 From: Calvin Bochulak Date: Wed, 12 Jun 2024 22:09:30 -0600 Subject: [PATCH 046/323] fix(ui): use `LazyVim.pick` for alpha.nvim and mini.starter extras (#3611) ## What is this PR for? Make other nvim dashboards use LazyVim.pick so they can also make use of fzf-lua when the extra is enabled. In addition, aligned the sections to be the same as dashboard.nvim. **Note**: this is somewhat untested. I haven't tested each dashboard and their sections to make sure they all work. ## Does this PR fix an existing issue? ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --------- Co-authored-by: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> --- lua/lazyvim/plugins/extras/ui/alpha.lua | 10 +++++----- lua/lazyvim/plugins/extras/ui/mini-starter.lua | 18 +++++++++--------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lua/lazyvim/plugins/extras/ui/alpha.lua b/lua/lazyvim/plugins/extras/ui/alpha.lua index 8feee188..1898bd08 100644 --- a/lua/lazyvim/plugins/extras/ui/alpha.lua +++ b/lua/lazyvim/plugins/extras/ui/alpha.lua @@ -23,11 +23,11 @@ return { dashboard.section.header.val = vim.split(logo, "\n") -- stylua: ignore dashboard.section.buttons.val = { - dashboard.button("f", " " .. " Find file", " Telescope find_files "), - dashboard.button("n", " " .. " New file", " ene startinsert "), - dashboard.button("r", " " .. " Recent files", " Telescope oldfiles "), - dashboard.button("g", " " .. " Find text", " Telescope live_grep "), - dashboard.button("c", " " .. " Config", " lua require('lazyvim.util').telescope.config_files()() "), + dashboard.button("f", " " .. " Find file", LazyVim.pick()), + dashboard.button("n", " " .. " New file", [[ ene startinsert ]]), + 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("s", " " .. " Restore Session", [[ lua require("persistence").load() ]]), dashboard.button("x", " " .. " Lazy Extras", " LazyExtras "), dashboard.button("l", "󰒲 " .. " Lazy", " Lazy "), diff --git a/lua/lazyvim/plugins/extras/ui/mini-starter.lua b/lua/lazyvim/plugins/extras/ui/mini-starter.lua index e6078d60..ac2f3aab 100644 --- a/lua/lazyvim/plugins/extras/ui/mini-starter.lua +++ b/lua/lazyvim/plugins/extras/ui/mini-starter.lua @@ -29,15 +29,15 @@ return { evaluate_single = true, header = logo, items = { - new_section("Find file", "Telescope find_files", "Telescope"), - new_section("Recent files", "Telescope oldfiles", "Telescope"), - new_section("Grep text", "Telescope live_grep", "Telescope"), - new_section("Config", "lua require('lazyvim.util').telescope.config_files()()", "Config"), - new_section("Extras", "LazyExtras", "Config"), - new_section("Lazy", "Lazy", "Config"), - new_section("New file", "ene | startinsert", "Built-in"), - new_section("Quit", "qa", "Built-in"), - new_section("Session restore", [[lua require("persistence").load()]], "Session"), + new_section("Find file", LazyVim.pick(), "Telescope"), + new_section("New file", "ene | startinsert", "Built-in"), + new_section("Recent files", LazyVim.pick("oldfiles"), "Telescope"), + new_section("Find text", LazyVim.pick("live_grep"), "Telescope"), + new_section("Config", LazyVim.pick.config_files(), "Config"), + new_section("Restore session", [[lua require("persistence").load()]], "Session"), + new_section("Lazy Extras", "LazyExtras", "Config"), + new_section("Lazy", "Lazy", "Config"), + new_section("Quit", "qa", "Built-in"), }, content_hooks = { starter.gen_hook.adding_bullet(pad .. "░ ", false), From 425e6e0ea3006c87645240d003a3b289cbfc446a Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 13 Jun 2024 06:13:39 +0200 Subject: [PATCH 047/323] fix(pick): use LazyVim.pick instead of M since dashboard dumps/loadstrings functions. Why though... Fixes #3617 --- lua/lazyvim/util/init.lua | 1 - lua/lazyvim/util/pick.lua | 8 +------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/lua/lazyvim/util/init.lua b/lua/lazyvim/util/init.lua index 212d6ae6..47efa485 100644 --- a/lua/lazyvim/util/init.lua +++ b/lua/lazyvim/util/init.lua @@ -5,7 +5,6 @@ local LazyUtil = require("lazy.core.util") ---@field ui lazyvim.util.ui ---@field lsp lazyvim.util.lsp ---@field root lazyvim.util.root ----@field telescope lazyvim.util.telescope ---@field terminal lazyvim.util.terminal ---@field lazygit lazyvim.util.lazygit ---@field toggle lazyvim.util.toggle diff --git a/lua/lazyvim/util/pick.lua b/lua/lazyvim/util/pick.lua index b8e4a94b..4c768343 100644 --- a/lua/lazyvim/util/pick.lua +++ b/lua/lazyvim/util/pick.lua @@ -84,16 +84,10 @@ end function M.wrap(command, opts) opts = opts or {} return function() - M.open(command, vim.deepcopy(opts)) + LazyVim.pick.open(command, vim.deepcopy(opts)) end end ----@param command string ----@param opts? lazyvim.util.pick.Opts -function M._open(command, opts) - return LazyVim.telescope.open(command, opts) -end - function M.config_files() return M.wrap("files", { cwd = vim.fn.stdpath("config") }) end From 8346fa7ddc9390312408be571c6443c0b57b9f21 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 13 Jun 2024 06:33:10 +0200 Subject: [PATCH 048/323] refactor(lsp): remove lsp keymap dependency on telescope --- .../plugins/extras/editor/telescope.lua | 18 ++++++++++++++---- lua/lazyvim/plugins/lsp/keymaps.lua | 8 ++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/lua/lazyvim/plugins/extras/editor/telescope.lua b/lua/lazyvim/plugins/extras/editor/telescope.lua index 7bbe4c16..c6a6a3ea 100644 --- a/lua/lazyvim/plugins/extras/editor/telescope.lua +++ b/lua/lazyvim/plugins/extras/editor/telescope.lua @@ -1,7 +1,3 @@ --- TODO: --- - [ ] remove telescope util --- - [ ] better lsp bindings - ---@type LazyPicker local picker = { name = "telescope", @@ -242,4 +238,18 @@ return { end end, }, + + { + "neovim/nvim-lspconfig", + opts = function() + local Keys = require("lazyvim.plugins.lsp.keymaps").get() + -- stylua: ignore + vim.list_extend(Keys, { + { "gd", function() require("telescope.builtin").lsp_definitions({ reuse_win = true }) end, desc = "Goto Definition", has = "definition" }, + { "gr", "Telescope lsp_references", desc = "References", nowait = true }, + { "gI", function() require("telescope.builtin").lsp_implementations({ reuse_win = true }) end, desc = "Goto Implementation" }, + { "gy", function() require("telescope.builtin").lsp_type_definitions({ reuse_win = true }) end, desc = "Goto T[y]pe Definition" }, + }) + end, + }, } diff --git a/lua/lazyvim/plugins/lsp/keymaps.lua b/lua/lazyvim/plugins/lsp/keymaps.lua index 403c3db9..12ae59be 100644 --- a/lua/lazyvim/plugins/lsp/keymaps.lua +++ b/lua/lazyvim/plugins/lsp/keymaps.lua @@ -14,11 +14,11 @@ function M.get() -- stylua: ignore M._keys = { { "cl", "LspInfo", desc = "Lsp Info" }, - { "gd", function() require("telescope.builtin").lsp_definitions({ reuse_win = true }) end, desc = "Goto Definition", has = "definition" }, - { "gr", "Telescope lsp_references", desc = "References", nowait = true }, + { "gd", vim.lsp.buf.definition(), desc = "Goto Definition", has = "definition" }, + { "gr", vim.lsp.buf.references(), desc = "References", nowait = true }, + { "gI", vim.lsp.buf.implementation(), desc = "Goto Implementation" }, + { "gy", vim.lsp.buf.type_definition(), desc = "Goto T[y]pe Definition" }, { "gD", vim.lsp.buf.declaration, desc = "Goto Declaration" }, - { "gI", function() require("telescope.builtin").lsp_implementations({ reuse_win = true }) end, desc = "Goto Implementation" }, - { "gy", function() require("telescope.builtin").lsp_type_definitions({ reuse_win = true }) end, desc = "Goto T[y]pe Definition" }, { "K", vim.lsp.buf.hover, desc = "Hover" }, { "gK", vim.lsp.buf.signature_help, desc = "Signature Help", has = "signatureHelp" }, { "", vim.lsp.buf.signature_help, mode = "i", desc = "Signature Help", has = "signatureHelp" }, From e948435f17afbbccfe1e7f2b355977efce9f1ff8 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 13 Jun 2024 13:05:16 +0200 Subject: [PATCH 049/323] feat(fzf): better layout for code actions --- lua/lazyvim/plugins/extras/editor/fzf.lua | 26 ++++++++++++++++------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/lua/lazyvim/plugins/extras/editor/fzf.lua b/lua/lazyvim/plugins/extras/editor/fzf.lua index 2a5f28c4..ada0f0ad 100644 --- a/lua/lazyvim/plugins/extras/editor/fzf.lua +++ b/lua/lazyvim/plugins/extras/editor/fzf.lua @@ -87,18 +87,28 @@ return { }, -- Custom LazyVim option to configure vim.ui.select ui_select = function(fzf_opts, items) - local title = vim.trim((fzf_opts.prompt or "Select"):gsub("%s*:%s*$", "")) - local width, height ---@type number?, number? - if fzf_opts.kind ~= "codeaction" then - width, height = 0.5, math.floor(math.min(vim.o.lines * 0.8, #items + 2) + 0.5) - end return vim.tbl_deep_extend("force", fzf_opts, { prompt = " ", winopts = { - title = " " .. title .. " ", + title = " " .. vim.trim((fzf_opts.prompt or "Select"):gsub("%s*:%s*$", "")) .. " ", title_pos = "center", - width = width, - height = height, + }, + }, fzf_opts.kind == "codeaction" and { + winopts = { + layout = "vertical", + -- 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 = { + layout = "vertical", + vertical = "down:15,border-top", + }, + }, + } or { + winopts = { + width = 0.5, + -- height is number of items, with a max of 80% screen height + height = math.floor(math.min(vim.o.lines * 0.8, #items + 2) + 0.5), }, }) end, From b9f726404fce2f5db8bfec713ed3e053537586ad Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Thu, 13 Jun 2024 14:54:58 +0300 Subject: [PATCH 050/323] fix(pick): move some leftovers from `editor.lua` to `editor.telescope` (#3620) ## What is this PR for? `have_make` and `have_cmake` were left over at `/lua/plugins/editor.lua`, so move them to `extras.editor.telescope` instead. ## Does this PR fix an existing issue? No ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/editor.lua | 3 --- lua/lazyvim/plugins/extras/editor/telescope.lua | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index f3f9da7b..591497d6 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -1,6 +1,3 @@ -local have_make = vim.fn.executable("make") == 1 -local have_cmake = vim.fn.executable("cmake") == 1 - return { -- file explorer diff --git a/lua/lazyvim/plugins/extras/editor/telescope.lua b/lua/lazyvim/plugins/extras/editor/telescope.lua index c6a6a3ea..52335fa7 100644 --- a/lua/lazyvim/plugins/extras/editor/telescope.lua +++ b/lua/lazyvim/plugins/extras/editor/telescope.lua @@ -1,3 +1,6 @@ +local have_make = vim.fn.executable("make") == 1 +local have_cmake = vim.fn.executable("cmake") == 1 + ---@type LazyPicker local picker = { name = "telescope", From 1d50c75a4b149f1cf00f4d4163f1469bc2fa77fc Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 13 Jun 2024 15:01:44 +0200 Subject: [PATCH 051/323] fix(dashboard): proper fix for dashboard's weird action loading --- lua/lazyvim/plugins/ui.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index 744585c0..384ec590 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -325,11 +325,11 @@ return { header = vim.split(logo, "\n"), -- stylua: ignore center = { - { action = LazyVim.pick(), desc = " Find File", icon = " ", key = "f" }, + { action = 'lua LazyVim.pick()()', desc = " Find File", icon = " ", key = "f" }, { action = "ene | startinsert", desc = " New File", icon = " ", key = "n" }, - { action = LazyVim.pick("oldfiles"), desc = " Recent Files", icon = " ", key = "r" }, - { action = LazyVim.pick("live_grep"), desc = " Find Text", icon = " ", key = "g" }, - { action = LazyVim.pick.config_files(), desc = " Config", icon = " ", key = "c" }, + { 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" }, From 48a70aa8f5e201dc6c0a4997f4084193dd9b29a5 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 13 Jun 2024 17:01:19 +0200 Subject: [PATCH 052/323] fix(pick): ignore registering the same picker --- lua/lazyvim/util/pick.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/util/pick.lua b/lua/lazyvim/util/pick.lua index 4c768343..aa3c20ea 100644 --- a/lua/lazyvim/util/pick.lua +++ b/lua/lazyvim/util/pick.lua @@ -32,7 +32,7 @@ function M.register(picker) if vim.v.vim_did_enter == 1 then return true end - if M.picker then + 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 .. "`" ) From 74c1766479411357054819b5d8c8376ca12c2504 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 13 Jun 2024 17:01:38 +0200 Subject: [PATCH 053/323] fix(python): only enable venv-selector when telescope is availble. See #3612 --- lua/lazyvim/plugins/extras/lang/python.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua/lazyvim/plugins/extras/lang/python.lua b/lua/lazyvim/plugins/extras/lang/python.lua index 0be4b93c..e328a51f 100644 --- a/lua/lazyvim/plugins/extras/lang/python.lua +++ b/lua/lazyvim/plugins/extras/lang/python.lua @@ -96,10 +96,14 @@ return { end, }, }, + { "linux-cultist/venv-selector.nvim", branch = "regexp", -- Use this branch for the new version cmd = "VenvSelect", + enabled = function() + return LazyVim.has("telescope.nvim") + end, opts = { settings = { options = { @@ -111,6 +115,7 @@ return { ft = "python", keys = { { "cv", ":VenvSelect", desc = "Select VirtualEnv", ft = "python" } }, }, + { "hrsh7th/nvim-cmp", opts = function(_, opts) From 7bebc40333c59660b6bff7ac67bff510aecf4fb2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 13 Jun 2024 17:49:40 +0200 Subject: [PATCH 054/323] chore(main): release 12.14.0 (#3594) :robot: I have created a release *beep* *boop* --- ## [12.14.0](https://github.com/LazyVim/LazyVim/compare/v12.13.0...v12.14.0) (2024-06-13) ### Features * **fzf:** better default window size/position ([74cf6e4](https://github.com/LazyVim/LazyVim/commit/74cf6e446247661ccb074838f92537c96a378ff4)) * **fzf:** better layout for code actions ([e948435](https://github.com/LazyVim/LazyVim/commit/e948435f17afbbccfe1e7f2b355977efce9f1ff8)) * **fzf:** disable dressing in favor of noice (vim.ui.input) and fzf-lua (vim.ui.select) ([5c876b7](https://github.com/LazyVim/LazyVim/commit/5c876b754999eb5fe8b79c5b6f5249b5bbddb454)) * **fzf:** use vscode style path names formatter ([14d1ca9](https://github.com/LazyVim/LazyVim/commit/14d1ca93d0e927b60fdf43424158f2336437f3a6)) * **noice:** added support for fzf-lua. Closes [#3596](https://github.com/LazyVim/LazyVim/issues/3596) ([ec3dba2](https://github.com/LazyVim/LazyVim/commit/ec3dba20af86187a44c953eb326725f76559cc12)) * **pick:** move pickers to extras (telescope still the default) ([#3606](https://github.com/LazyVim/LazyVim/issues/3606)) ([39a908c](https://github.com/LazyVim/LazyVim/commit/39a908c9faca2387c5444de89191275b7bd02576)) * **yanky:** added fzf-lua support ([82f680e](https://github.com/LazyVim/LazyVim/commit/82f680ee6b681f9f39fbfb8431a4f362af134d1c)) ### Bug Fixes * **dashboard:** proper fix for dashboard's weird action loading ([1d50c75](https://github.com/LazyVim/LazyVim/commit/1d50c75a4b149f1cf00f4d4163f1469bc2fa77fc)) * **lsp:** add file completion to rename file ([52b5728](https://github.com/LazyVim/LazyVim/commit/52b572881b6fcbc805e5e584c4970c920d314f86)) * **pick:** ignore registering the same picker ([48a70aa](https://github.com/LazyVim/LazyVim/commit/48a70aa8f5e201dc6c0a4997f4084193dd9b29a5)) * **pick:** move some leftovers from `editor.lua` to `editor.telescope` ([#3620](https://github.com/LazyVim/LazyVim/issues/3620)) ([b9f7264](https://github.com/LazyVim/LazyVim/commit/b9f726404fce2f5db8bfec713ed3e053537586ad)) * **pick:** use LazyVim.pick instead of M since dashboard dumps/loadstrings functions. Why though... Fixes [#3617](https://github.com/LazyVim/LazyVim/issues/3617) ([425e6e0](https://github.com/LazyVim/LazyVim/commit/425e6e0ea3006c87645240d003a3b289cbfc446a)) * **project:** add fzf-lua integration. Fixes [#3609](https://github.com/LazyVim/LazyVim/issues/3609) ([4b9e4ed](https://github.com/LazyVim/LazyVim/commit/4b9e4edbb115f1f13906b2cdb68986e336b05729)) * **project:** telescope name ([d82c11f](https://github.com/LazyVim/LazyVim/commit/d82c11f889b03effa5248170ac1b4b4681391f08)) * **python:** only enable venv-selector when telescope is availble. See [#3612](https://github.com/LazyVim/LazyVim/issues/3612) ([74c1766](https://github.com/LazyVim/LazyVim/commit/74c1766479411357054819b5d8c8376ca12c2504)) * **ui:** use `LazyVim.pick` for alpha.nvim and mini.starter extras ([#3611](https://github.com/LazyVim/LazyVim/issues/3611)) ([339979d](https://github.com/LazyVim/LazyVim/commit/339979d3143d46a37c304d45a00c7a4f448e707d)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 833330ce..964e021c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,31 @@ # Changelog +## [12.14.0](https://github.com/LazyVim/LazyVim/compare/v12.13.0...v12.14.0) (2024-06-13) + + +### Features + +* **fzf:** better default window size/position ([74cf6e4](https://github.com/LazyVim/LazyVim/commit/74cf6e446247661ccb074838f92537c96a378ff4)) +* **fzf:** better layout for code actions ([e948435](https://github.com/LazyVim/LazyVim/commit/e948435f17afbbccfe1e7f2b355977efce9f1ff8)) +* **fzf:** disable dressing in favor of noice (vim.ui.input) and fzf-lua (vim.ui.select) ([5c876b7](https://github.com/LazyVim/LazyVim/commit/5c876b754999eb5fe8b79c5b6f5249b5bbddb454)) +* **fzf:** use vscode style path names formatter ([14d1ca9](https://github.com/LazyVim/LazyVim/commit/14d1ca93d0e927b60fdf43424158f2336437f3a6)) +* **noice:** added support for fzf-lua. Closes [#3596](https://github.com/LazyVim/LazyVim/issues/3596) ([ec3dba2](https://github.com/LazyVim/LazyVim/commit/ec3dba20af86187a44c953eb326725f76559cc12)) +* **pick:** move pickers to extras (telescope still the default) ([#3606](https://github.com/LazyVim/LazyVim/issues/3606)) ([39a908c](https://github.com/LazyVim/LazyVim/commit/39a908c9faca2387c5444de89191275b7bd02576)) +* **yanky:** added fzf-lua support ([82f680e](https://github.com/LazyVim/LazyVim/commit/82f680ee6b681f9f39fbfb8431a4f362af134d1c)) + + +### Bug Fixes + +* **dashboard:** proper fix for dashboard's weird action loading ([1d50c75](https://github.com/LazyVim/LazyVim/commit/1d50c75a4b149f1cf00f4d4163f1469bc2fa77fc)) +* **lsp:** add file completion to rename file ([52b5728](https://github.com/LazyVim/LazyVim/commit/52b572881b6fcbc805e5e584c4970c920d314f86)) +* **pick:** ignore registering the same picker ([48a70aa](https://github.com/LazyVim/LazyVim/commit/48a70aa8f5e201dc6c0a4997f4084193dd9b29a5)) +* **pick:** move some leftovers from `editor.lua` to `editor.telescope` ([#3620](https://github.com/LazyVim/LazyVim/issues/3620)) ([b9f7264](https://github.com/LazyVim/LazyVim/commit/b9f726404fce2f5db8bfec713ed3e053537586ad)) +* **pick:** use LazyVim.pick instead of M since dashboard dumps/loadstrings functions. Why though... Fixes [#3617](https://github.com/LazyVim/LazyVim/issues/3617) ([425e6e0](https://github.com/LazyVim/LazyVim/commit/425e6e0ea3006c87645240d003a3b289cbfc446a)) +* **project:** add fzf-lua integration. Fixes [#3609](https://github.com/LazyVim/LazyVim/issues/3609) ([4b9e4ed](https://github.com/LazyVim/LazyVim/commit/4b9e4edbb115f1f13906b2cdb68986e336b05729)) +* **project:** telescope name ([d82c11f](https://github.com/LazyVim/LazyVim/commit/d82c11f889b03effa5248170ac1b4b4681391f08)) +* **python:** only enable venv-selector when telescope is availble. See [#3612](https://github.com/LazyVim/LazyVim/issues/3612) ([74c1766](https://github.com/LazyVim/LazyVim/commit/74c1766479411357054819b5d8c8376ca12c2504)) +* **ui:** use `LazyVim.pick` for alpha.nvim and mini.starter extras ([#3611](https://github.com/LazyVim/LazyVim/issues/3611)) ([339979d](https://github.com/LazyVim/LazyVim/commit/339979d3143d46a37c304d45a00c7a4f448e707d)) + ## [12.13.0](https://github.com/LazyVim/LazyVim/compare/v12.12.0...v12.13.0) (2024-06-11) From 427e57ddf7030f7081d858d923fb9337f94bf0a7 Mon Sep 17 00:00:00 2001 From: xiaojianzheng <1272209235@qq.com> Date: Fri, 14 Jun 2024 14:24:14 +0800 Subject: [PATCH 055/323] fix(fzf): floating previewer closed fail (#3638) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - floating previewer closed fail. https://github.com/LazyVim/LazyVim/issues/3582 Co-authored-by: 肖健正 --- lua/lazyvim/plugins/extras/editor/fzf.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/editor/fzf.lua b/lua/lazyvim/plugins/extras/editor/fzf.lua index ada0f0ad..088c1e19 100644 --- a/lua/lazyvim/plugins/extras/editor/fzf.lua +++ b/lua/lazyvim/plugins/extras/editor/fzf.lua @@ -155,7 +155,7 @@ return { require("fzf-lua").register_ui_select(opts.ui_select or nil) end, keys = { - { "", "close", ft = "fzf", mode = "t", nowait = true }, + { "", "", ft = "fzf", mode = "t", nowait = true }, { "", "", ft = "fzf", mode = "t", nowait = true }, { "", "", ft = "fzf", mode = "t", nowait = true }, { From c424f5d5d8eb42a4463b2ff76de45c0bff964cbc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 14 Jun 2024 06:24:52 +0000 Subject: [PATCH 056/323] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index f95204b9..408103de 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 13 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 14 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 7c7703d79226cda99b1ec3d25fbfff54af04ba5b Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 14 Jun 2024 08:31:56 +0200 Subject: [PATCH 057/323] fix(fzf): esc and nowait --- lua/lazyvim/plugins/extras/editor/fzf.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/extras/editor/fzf.lua b/lua/lazyvim/plugins/extras/editor/fzf.lua index 088c1e19..56aeead2 100644 --- a/lua/lazyvim/plugins/extras/editor/fzf.lua +++ b/lua/lazyvim/plugins/extras/editor/fzf.lua @@ -76,7 +76,7 @@ return { end fix(defaults) - return vim.tbl_deep_extend("force", opts, defaults, { + return vim.tbl_deep_extend("force", defaults, { fzf_colors = true, fzf_opts = { ["--no-scrollbar"] = true, @@ -155,7 +155,7 @@ return { require("fzf-lua").register_ui_select(opts.ui_select or nil) end, keys = { - { "", "", ft = "fzf", mode = "t", nowait = true }, + { "", "", ft = "fzf", mode = "t", nowait = true }, { "", "", ft = "fzf", mode = "t", nowait = true }, { "", "", ft = "fzf", mode = "t", nowait = true }, { From 25cccb5db858ad0640fd6a9eb5da4c5f465749d9 Mon Sep 17 00:00:00 2001 From: Lucas Date: Fri, 14 Jun 2024 10:10:54 +0200 Subject: [PATCH 058/323] fix(issue template): repro.lua didn't work (#3628) ## What is this PR for? repro.lua didn't work. at least i don't think it's the intended behaviour. it installed lazy.vim, lazy.nvim, tokyonight. but didn't actually load lazyvim, and so none of it's plugins config etc... ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 03fbd8ca..2103ea51 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -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, { From 6efbdabd1b2272401566354686ce85e1372fe925 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 14 Jun 2024 10:20:40 +0200 Subject: [PATCH 059/323] fix(edgy): only track other neo-tree windows with a source --- lua/lazyvim/plugins/extras/ui/edgy.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/ui/edgy.lua b/lua/lazyvim/plugins/extras/ui/edgy.lua index 4ccdc5f0..f7645879 100644 --- a/lua/lazyvim/plugins/extras/ui/edgy.lua +++ b/lua/lazyvim/plugins/extras/ui/edgy.lua @@ -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 From eeccbbc40721bb825182251acf201750741c77b2 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 14 Jun 2024 11:13:56 +0200 Subject: [PATCH 060/323] fix(extras): better reasons as to why some extras are included in your config. --- lua/lazyvim/plugins/compat/nvim-0_9.lua | 9 ++++++++ lua/lazyvim/plugins/xtras.lua | 3 ++- lua/lazyvim/util/extras.lua | 28 +++++++++++++++++++++---- lua/lazyvim/util/plugin.lua | 10 +++++++++ 4 files changed, 45 insertions(+), 5 deletions(-) diff --git a/lua/lazyvim/plugins/compat/nvim-0_9.lua b/lua/lazyvim/plugins/compat/nvim-0_9.lua index 6488952b..4f971b6f 100644 --- a/lua/lazyvim/plugins/compat/nvim-0_9.lua +++ b/lua/lazyvim/plugins/compat/nvim-0_9.lua @@ -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, + }, } diff --git a/lua/lazyvim/plugins/xtras.lua b/lua/lazyvim/plugins/xtras.lua index e636c255..24d5fcd2 100644 --- a/lua/lazyvim/plugins/xtras.lua +++ b/lua/lazyvim/plugins/xtras.lua @@ -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) diff --git a/lua/lazyvim/util/extras.lua b/lua/lazyvim/util/extras.lua index afa0ae2f..2fdef824 100644 --- a/lua/lazyvim/util/extras.lua +++ b/lua/lazyvim/util/extras.lua @@ -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" diff --git a/lua/lazyvim/util/plugin.lua b/lua/lazyvim/util/plugin.lua index f34527ac..1520bdce 100644 --- a/lua/lazyvim/util/plugin.lua +++ b/lua/lazyvim/util/plugin.lua @@ -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 @@ -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() From 239fb90ce216d93706f2c27b4a9a54eef42ed437 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 14 Jun 2024 16:46:35 +0200 Subject: [PATCH 061/323] style: cleanup trouble --- lua/lazyvim/plugins/editor.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 591497d6..180539a5 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -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 = { { "xx", "Trouble diagnostics toggle", desc = "Diagnostics (Trouble)" }, { "xX", "Trouble diagnostics toggle filter.buf=0", desc = "Buffer Diagnostics (Trouble)" }, From c9380a309dbdc9fe45ec1bc9f8f27700540c2eea Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 14 Jun 2024 17:53:44 +0200 Subject: [PATCH 062/323] fix(fzf): esc and c-j, c-k keymaps with nowait. update fzf-lua as well --- lua/lazyvim/plugins/extras/editor/fzf.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lua/lazyvim/plugins/extras/editor/fzf.lua b/lua/lazyvim/plugins/extras/editor/fzf.lua index 56aeead2..38e2c0f1 100644 --- a/lua/lazyvim/plugins/extras/editor/fzf.lua +++ b/lua/lazyvim/plugins/extras/editor/fzf.lua @@ -155,9 +155,8 @@ return { require("fzf-lua").register_ui_select(opts.ui_select or nil) end, keys = { - { "", "", ft = "fzf", mode = "t", nowait = true }, - { "", "", ft = "fzf", mode = "t", nowait = true }, - { "", "", ft = "fzf", mode = "t", nowait = true }, + { "", "", ft = "fzf", mode = "t", nowait = true }, + { "", "", ft = "fzf", mode = "t", nowait = true }, { ",", "FzfLua buffers sort_mru=true sort_lastused=true", From 304e7439aa8ae646adafb737b292707bf77a31d9 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 14 Jun 2024 17:55:43 +0200 Subject: [PATCH 063/323] fix(pick): allow configuring pickers without LazyExtras. Fixes #3626 --- lua/lazyvim/config/options.lua | 6 ++++++ lua/lazyvim/plugins/editor.lua | 4 ++-- lua/lazyvim/plugins/extras/editor/fzf.lua | 6 ++++++ lua/lazyvim/plugins/extras/editor/telescope.lua | 15 +++++++++++++++ lua/lazyvim/util/pick.lua | 13 +++++++++++++ 5 files changed, 42 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/config/options.lua b/lua/lazyvim/config/options.lua index b82a763a..d2f8e24a 100644 --- a/lua/lazyvim/config/options.lua +++ b/lua/lazyvim/config/options.lua @@ -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` diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 180539a5..05fe5c25 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -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, }, } diff --git a/lua/lazyvim/plugins/extras/editor/fzf.lua b/lua/lazyvim/plugins/extras/editor/fzf.lua index 38e2c0f1..06765407 100644 --- a/lua/lazyvim/plugins/extras/editor/fzf.lua +++ b/lua/lazyvim/plugins/extras/editor/fzf.lua @@ -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? diff --git a/lua/lazyvim/plugins/extras/editor/telescope.lua b/lua/lazyvim/plugins/extras/editor/telescope.lua index 52335fa7..faeb16b9 100644 --- a/lua/lazyvim/plugins/extras/editor/telescope.lua +++ b/lua/lazyvim/plugins/extras/editor/telescope.lua @@ -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, { diff --git a/lua/lazyvim/util/pick.lua b/lua/lazyvim/util/pick.lua index aa3c20ea..e8b08e93 100644 --- a/lua/lazyvim/util/pick.lua +++ b/lua/lazyvim/util/pick.lua @@ -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) From 3dbb4bd5f6e851a9389c4498be4ed4ad7ea4494a Mon Sep 17 00:00:00 2001 From: xiaojianzheng <1272209235@qq.com> Date: Sat, 15 Jun 2024 00:04:53 +0800 Subject: [PATCH 064/323] docs: add link to LazyVim For Ambitious Developers to README-CN.md (#3644) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 肖健正(家和) --- README-CN.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README-CN.md b/README-CN.md index 395e146e..b78a398a 100644 --- a/README-CN.md +++ b/README-CN.md @@ -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 下的文件会在适当的时候自动加载,所以你不需要手动引入这些文件。 From 034f57377b4021133338d2222b49ee7050fb76a0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 14 Jun 2024 18:05:12 +0200 Subject: [PATCH 065/323] chore(main): release 12.14.1 (#3639) :robot: I have created a release *beep* *boop* --- ## [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)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 964e021c..47130543 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) From 5070694861f91ac258fbf851ed771294cafafb8f Mon Sep 17 00:00:00 2001 From: xiaojianzheng <1272209235@qq.com> Date: Sat, 15 Jun 2024 05:06:53 +0800 Subject: [PATCH 066/323] fix(vue): disable volar hybrid mode since it interferes with tsserver (#3654) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit can not inc-rename when volar is enabled. After the configuration in commit was added, the inc-rename operation returned to normal. I suspect that volar's Hybrid mode affects the rename operation. https://github.com/vuejs/language-tools?tab=readme-ov-file#none-hybrid-modesimilar-to-takeover-mode-configuration-requires-vuelanguage-server-version-207 Co-authored-by: 肖健正 --- lua/lazyvim/plugins/extras/lang/vue.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/vue.lua b/lua/lazyvim/plugins/extras/lang/vue.lua index 45f1a9f7..cd2fe4f1 100644 --- a/lua/lazyvim/plugins/extras/lang/vue.lua +++ b/lua/lazyvim/plugins/extras/lang/vue.lua @@ -19,7 +19,13 @@ return { "neovim/nvim-lspconfig", opts = { servers = { - volar = {}, + volar = { + init_options = { + vue = { + hybridMode = false, + }, + }, + }, vtsls = {}, }, }, From 2d689763e43f9c744f4893a6d68fcb8308502053 Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Sat, 15 Jun 2024 00:07:42 +0300 Subject: [PATCH 067/323] fix(rust): incorporate latest changes from `rustaceanvim` (#3655) ## What is this PR for? After recent changes in `rustaceanvim` in https://github.com/mrcjkb/rustaceanvim/pull/403, `checkOnSave` is supposed to be boolean and the table that we were passing to `checkOnSave` previously should be passed to `check` instead. I left the `check` table undefined, because the options that we were passing to `checkOnSave` before are the default ones being passed to `check`. So, only if the user wants to change something should he change the values of the `check` table according to what he wants. ## Does this PR fix an existing issue? No ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/lang/rust.lua | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/rust.lua b/lua/lazyvim/plugins/extras/lang/rust.lua index a24d85f9..9e8655b4 100644 --- a/lua/lazyvim/plugins/extras/lang/rust.lua +++ b/lua/lazyvim/plugins/extras/lang/rust.lua @@ -65,11 +65,7 @@ return { }, }, -- Add clippy lints for Rust. - checkOnSave = { - allFeatures = true, - command = "clippy", - extraArgs = { "--no-deps" }, - }, + checkOnSave = true, procMacro = { enable = true, ignored = { From e1f587a43dce83c652db5c6742cf516d983152a3 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 15 Jun 2024 00:34:49 +0200 Subject: [PATCH 068/323] fix(fzf): only add trouble integration when trouble is available --- lua/lazyvim/plugins/extras/editor/fzf.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/editor/fzf.lua b/lua/lazyvim/plugins/extras/editor/fzf.lua index 06765407..4516a64b 100644 --- a/lua/lazyvim/plugins/extras/editor/fzf.lua +++ b/lua/lazyvim/plugins/extras/editor/fzf.lua @@ -57,7 +57,9 @@ return { config.defaults.keymap.builtin[""] = "preview-page-up" -- Trouble - config.defaults.actions.files["ctrl-t"] = require("trouble.sources.fzf").actions.open + if LazyVim.has("trouble.nvim") then + config.defaults.actions.files["ctrl-t"] = require("trouble.sources.fzf").actions.open + end -- Toggle root dir / cwd config.defaults.actions.files["ctrl-r"] = function(_, ctx) From 06f5ef928f61dbb64ee0555cddf556bc01cc62f4 Mon Sep 17 00:00:00 2001 From: Ahmed Kamal Date: Sat, 15 Jun 2024 17:30:39 +1000 Subject: [PATCH 069/323] fix(elixir): add missing lspconfig (#3661) ## What is this PR for? add missing elixir lspconfig ## Does this PR fix an existing issue? lspconfig is missing for elixir and since mason was removed in https://github.com/LazyVim/LazyVim/commit/f8268faa7c705cca7047fbaef5984905b47a7324, elixirls is no longer automatically installed. ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/lang/elixir.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lua/lazyvim/plugins/extras/lang/elixir.lua b/lua/lazyvim/plugins/extras/lang/elixir.lua index a9956570..3255ffff 100644 --- a/lua/lazyvim/plugins/extras/lang/elixir.lua +++ b/lua/lazyvim/plugins/extras/lang/elixir.lua @@ -5,6 +5,14 @@ return { root = "mix.exs", }) end, + { + "neovim/nvim-lspconfig", + opts = { + servers = { + elixirls = {}, + }, + }, + }, { "nvim-treesitter/nvim-treesitter", opts = { ensure_installed = { "elixir", "heex", "eex" } }, From 6c5be2ea44c434103f243b3ca63027745efa523e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 15 Jun 2024 07:31:11 +0000 Subject: [PATCH 070/323] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 408103de..f6b04d72 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 14 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 15 ============================================================================== Table of Contents *LazyVim-table-of-contents* From e0e1ab01af01f393d4c96f943faddcc62f6eda16 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 15 Jun 2024 10:19:46 +0200 Subject: [PATCH 071/323] fix(dap): make sure mason-dap is loaded after initializing dap. See #3663 --- lua/lazyvim/plugins/extras/dap/core.lua | 60 +++++++++++++------------ lua/lazyvim/plugins/extras/lang/php.lua | 6 --- 2 files changed, 31 insertions(+), 35 deletions(-) diff --git a/lua/lazyvim/plugins/extras/dap/core.lua b/lua/lazyvim/plugins/extras/dap/core.lua index b7a088c1..46269c35 100644 --- a/lua/lazyvim/plugins/extras/dap/core.lua +++ b/lua/lazyvim/plugins/extras/dap/core.lua @@ -17,33 +17,7 @@ return { desc = "Debugging support. Requires language specific adapters to be configured. (see lang extras)", dependencies = { - - -- fancy UI for the debugger - { - "rcarriga/nvim-dap-ui", - dependencies = { "nvim-neotest/nvim-nio" }, - -- stylua: ignore - keys = { - { "du", function() require("dapui").toggle({ }) end, desc = "Dap UI" }, - { "de", function() require("dapui").eval() end, desc = "Eval", mode = {"n", "v"} }, - }, - opts = {}, - config = function(_, opts) - local dap = require("dap") - local dapui = require("dapui") - dapui.setup(opts) - dap.listeners.after.event_initialized["dapui_config"] = function() - dapui.open({}) - end - dap.listeners.before.event_terminated["dapui_config"] = function() - dapui.close({}) - end - dap.listeners.before.event_exited["dapui_config"] = function() - dapui.close({}) - end - end, - }, - + "rcarriga/nvim-dap-ui", -- virtual text for the debugger { "theHamsta/nvim-dap-virtual-text", @@ -74,10 +48,12 @@ return { }, config = function() - local Config = require("lazyvim.config") + -- trigger loading mason-nvim-dap + require("mason-nvim-dap") + vim.api.nvim_set_hl(0, "DapStoppedLine", { default = true, link = "Visual" }) - for name, sign in pairs(Config.icons.dap) do + for name, sign in pairs(LazyVim.config.icons.dap) do sign = type(sign) == "table" and sign or { sign } vim.fn.sign_define( "Dap" .. name, @@ -94,6 +70,32 @@ return { end, }, + -- fancy UI for the debugger + { + "rcarriga/nvim-dap-ui", + dependencies = { "nvim-neotest/nvim-nio" }, + -- stylua: ignore + keys = { + { "du", function() require("dapui").toggle({ }) end, desc = "Dap UI" }, + { "de", function() require("dapui").eval() end, desc = "Eval", mode = {"n", "v"} }, + }, + opts = {}, + config = function(_, opts) + local dap = require("dap") + local dapui = require("dapui") + dapui.setup(opts) + dap.listeners.after.event_initialized["dapui_config"] = function() + dapui.open({}) + end + dap.listeners.before.event_terminated["dapui_config"] = function() + dapui.close({}) + end + dap.listeners.before.event_exited["dapui_config"] = function() + dapui.close({}) + end + end, + }, + -- mason.nvim integration { "jay-babu/mason-nvim-dap.nvim", diff --git a/lua/lazyvim/plugins/extras/lang/php.lua b/lua/lazyvim/plugins/extras/lang/php.lua index 0cb3a840..3b66b583 100644 --- a/lua/lazyvim/plugins/extras/lang/php.lua +++ b/lua/lazyvim/plugins/extras/lang/php.lua @@ -30,12 +30,6 @@ return { { "mfussenegger/nvim-dap", optional = true, - dependencies = { - "williamboman/mason.nvim", - opts = { ensure_installed = { - "php-debug-adapter", - } }, - }, opts = function() local dap = require("dap") local path = require("mason-registry").get_package("php-debug-adapter"):get_install_path() From 2b703ac125a21b48bb207d86cddbb461189d025b Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 15 Jun 2024 10:22:41 +0200 Subject: [PATCH 072/323] fix(dap): make sure mason-nvim-dap loads after nvim-dap --- lua/lazyvim/plugins/extras/dap/core.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/extras/dap/core.lua b/lua/lazyvim/plugins/extras/dap/core.lua index 46269c35..045fb022 100644 --- a/lua/lazyvim/plugins/extras/dap/core.lua +++ b/lua/lazyvim/plugins/extras/dap/core.lua @@ -48,8 +48,8 @@ return { }, config = function() - -- trigger loading mason-nvim-dap - require("mason-nvim-dap") + -- load mason-nvim-dap here, after all adapters have been setup + require("mason-nvim-dap").setup(LazyVim.opts("mason-nvim-dap.nvim")) vim.api.nvim_set_hl(0, "DapStoppedLine", { default = true, link = "Visual" }) @@ -116,5 +116,7 @@ return { -- Update this to ensure that you have the debuggers for the langs you want }, }, + -- mason-nvim-dap is loaded when nvim-dap loads + config = function() end, }, } From bf809ad2a1f6cd8f74451feacdd79af68d201d6e Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 15 Jun 2024 12:05:55 +0200 Subject: [PATCH 073/323] feat(mini.pairs): added some custom options to make mini.pairs behave better --- lua/lazyvim/plugins/coding.lua | 36 +++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index 155cfe80..39c89a48 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -142,9 +142,13 @@ return { "echasnovski/mini.pairs", event = "VeryLazy", opts = { - mappings = { - ["`"] = { action = "closeopen", pair = "``", neigh_pattern = "[^\\`].", register = { cr = false } }, - }, + -- skip autopair when next character is one of these + skip_next = [=[[%w%%%'%[%"%.%`%$]]=], + -- skip autopair when next character is closing pair + -- and there are more closing pairs than opening pairs + skip_unbalanced = true, + -- better deal with markdown code blocks + markdown = true, }, keys = { { @@ -160,6 +164,32 @@ return { desc = "Toggle Auto Pairs", }, }, + config = function(_, opts) + local pairs = require("mini.pairs") + pairs.setup(opts) + local open = pairs.open + pairs.open = function(pair, neigh_pattern) + local o, c = pair:sub(1, 1), pair:sub(2, 2) + local line = vim.api.nvim_get_current_line() + local cursor = vim.api.nvim_win_get_cursor(0) + local next = line:sub(cursor[2] + 1, cursor[2] + 1) + local before = line:sub(1, cursor[2]) + if opts.markdown and o == "`" and vim.bo.filetype == "markdown" and before:match("^%s*``") then + return "`\n```" .. vim.api.nvim_replace_termcodes("", true, true, true) + end + if opts.skip_next and next ~= "" and next:match(opts.skip_next) then + return o + end + if opts.skip_unbalanced and next == c and c ~= o then + local _, count_open = line:gsub(vim.pesc(pair:sub(1, 1)), "") + local _, count_close = line:gsub(vim.pesc(pair:sub(2, 2)), "") + if count_close > count_open then + return o + end + end + return open(pair, neigh_pattern) + end + end, }, -- comments From f28937b0c53195a90fb450d0f07bacd3321a0cfd Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 15 Jun 2024 12:22:09 +0200 Subject: [PATCH 074/323] feat(project): ctrl-t opens project in tab --- lua/lazyvim/plugins/extras/util/project.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/lazyvim/plugins/extras/util/project.lua b/lua/lazyvim/plugins/extras/util/project.lua index 395946fd..7a391c6a 100644 --- a/lua/lazyvim/plugins/extras/util/project.lua +++ b/lua/lazyvim/plugins/extras/util/project.lua @@ -5,6 +5,7 @@ local pick = function() local fzf_lua = require("fzf-lua") local history = require("project_nvim.utils.history") local results = history.get_recent_projects() + local actions = require("fzf-lua.actions") fzf_lua.fzf_exec(results, { actions = { ["default"] = { @@ -12,6 +13,7 @@ local pick = function() fzf_lua.files({ cwd = selected[1] }) end, }, + ["ctrl-t"] = actions.file_tabedit, }, }) end From 0422dd278a1b4e5bdbbc5b145eb161177d3ce810 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 15 Jun 2024 12:23:59 +0200 Subject: [PATCH 075/323] chore(main): release 12.15.0 (#3658) :robot: I have created a release *beep* *boop* --- ## [12.15.0](https://github.com/LazyVim/LazyVim/compare/v12.14.1...v12.15.0) (2024-06-15) ### Features * **mini.pairs:** added some custom options to make mini.pairs behave better ([bf809ad](https://github.com/LazyVim/LazyVim/commit/bf809ad2a1f6cd8f74451feacdd79af68d201d6e)) * **project:** ctrl-t opens project in tab ([f28937b](https://github.com/LazyVim/LazyVim/commit/f28937b0c53195a90fb450d0f07bacd3321a0cfd)) ### Bug Fixes * **dap:** make sure mason-dap is loaded after initializing dap. See [#3663](https://github.com/LazyVim/LazyVim/issues/3663) ([e0e1ab0](https://github.com/LazyVim/LazyVim/commit/e0e1ab01af01f393d4c96f943faddcc62f6eda16)) * **dap:** make sure mason-nvim-dap loads after nvim-dap ([2b703ac](https://github.com/LazyVim/LazyVim/commit/2b703ac125a21b48bb207d86cddbb461189d025b)) * **elixir:** add missing lspconfig ([#3661](https://github.com/LazyVim/LazyVim/issues/3661)) ([06f5ef9](https://github.com/LazyVim/LazyVim/commit/06f5ef928f61dbb64ee0555cddf556bc01cc62f4)) * **fzf:** only add trouble integration when trouble is available ([e1f587a](https://github.com/LazyVim/LazyVim/commit/e1f587a43dce83c652db5c6742cf516d983152a3)) * **rust:** incorporate latest changes from `rustaceanvim` ([#3655](https://github.com/LazyVim/LazyVim/issues/3655)) ([2d68976](https://github.com/LazyVim/LazyVim/commit/2d689763e43f9c744f4893a6d68fcb8308502053)) * **vue:** disable volar hybrid mode since it interferes with tsserver ([#3654](https://github.com/LazyVim/LazyVim/issues/3654)) ([5070694](https://github.com/LazyVim/LazyVim/commit/5070694861f91ac258fbf851ed771294cafafb8f)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 47130543..fa284f73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Changelog +## [12.15.0](https://github.com/LazyVim/LazyVim/compare/v12.14.1...v12.15.0) (2024-06-15) + + +### Features + +* **mini.pairs:** added some custom options to make mini.pairs behave better ([bf809ad](https://github.com/LazyVim/LazyVim/commit/bf809ad2a1f6cd8f74451feacdd79af68d201d6e)) +* **project:** ctrl-t opens project in tab ([f28937b](https://github.com/LazyVim/LazyVim/commit/f28937b0c53195a90fb450d0f07bacd3321a0cfd)) + + +### Bug Fixes + +* **dap:** make sure mason-dap is loaded after initializing dap. See [#3663](https://github.com/LazyVim/LazyVim/issues/3663) ([e0e1ab0](https://github.com/LazyVim/LazyVim/commit/e0e1ab01af01f393d4c96f943faddcc62f6eda16)) +* **dap:** make sure mason-nvim-dap loads after nvim-dap ([2b703ac](https://github.com/LazyVim/LazyVim/commit/2b703ac125a21b48bb207d86cddbb461189d025b)) +* **elixir:** add missing lspconfig ([#3661](https://github.com/LazyVim/LazyVim/issues/3661)) ([06f5ef9](https://github.com/LazyVim/LazyVim/commit/06f5ef928f61dbb64ee0555cddf556bc01cc62f4)) +* **fzf:** only add trouble integration when trouble is available ([e1f587a](https://github.com/LazyVim/LazyVim/commit/e1f587a43dce83c652db5c6742cf516d983152a3)) +* **rust:** incorporate latest changes from `rustaceanvim` ([#3655](https://github.com/LazyVim/LazyVim/issues/3655)) ([2d68976](https://github.com/LazyVim/LazyVim/commit/2d689763e43f9c744f4893a6d68fcb8308502053)) +* **vue:** disable volar hybrid mode since it interferes with tsserver ([#3654](https://github.com/LazyVim/LazyVim/issues/3654)) ([5070694](https://github.com/LazyVim/LazyVim/commit/5070694861f91ac258fbf851ed771294cafafb8f)) + ## [12.14.1](https://github.com/LazyVim/LazyVim/compare/v12.14.0...v12.14.1) (2024-06-14) From 67616b9520a5309d2e3565ff880b37ceef662179 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Freitas?= Date: Sat, 15 Jun 2024 12:59:54 +0000 Subject: [PATCH 076/323] fix(egdy): do not add panes for not enabled neo-tree sources (#3667) ## What is this PR for? When the user disables a specific neo-tree source (git_status or buffers), the panes are still created but throw an error when the user tries to open them **NB**: This is currently not functional because `LazyVim.opts` is returning an empty table instead of the neo-tree opts. I'm hoping someone can give me a hand with this little problem ## Does this PR fix an existing issue? ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/ui/edgy.lua | 44 +++++++++++++++----------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/lua/lazyvim/plugins/extras/ui/edgy.lua b/lua/lazyvim/plugins/extras/ui/edgy.lua index f7645879..e8708b16 100644 --- a/lua/lazyvim/plugins/extras/ui/edgy.lua +++ b/lua/lazyvim/plugins/extras/ui/edgy.lua @@ -66,24 +66,6 @@ return { size = { height = 0.5 }, }, { title = "Neotest Summary", ft = "neotest-summary" }, - { - title = "Neo-Tree Git", - ft = "neo-tree", - filter = function(buf) - return vim.b[buf].neo_tree_source == "git_status" - end, - pinned = true, - open = "Neotree position=right git_status", - }, - { - title = "Neo-Tree Buffers", - ft = "neo-tree", - filter = function(buf) - return vim.b[buf].neo_tree_source == "buffers" - end, - pinned = true, - open = "Neotree position=top buffers", - }, { title = "Neo-Tree Other", ft = "neo-tree", @@ -112,6 +94,32 @@ return { end, }, } + + -- only add neo-tree sources if they are enabled in config + if vim.list_contains(LazyVim.opts("neo-tree").sources, "buffers") then + table.insert(opts.left, 3, { + title = "Neo-Tree Buffers", + ft = "neo-tree", + filter = function(buf) + return vim.b[buf].neo_tree_source == "buffers" + end, + pinned = true, + open = "Neotree position=top buffers", + }) + end + + if vim.list_contains(LazyVim.opts("neo-tree").sources, "git_status") then + table.insert(opts.left, 3, { + title = "Neo-Tree Git", + ft = "neo-tree", + filter = function(buf) + return vim.b[buf].neo_tree_source == "git_status" + end, + pinned = true, + open = "Neotree position=right git_status", + }) + end + for _, pos in ipairs({ "top", "bottom", "left", "right" }) do opts[pos] = opts[pos] or {} table.insert(opts[pos], { From f22a6022c4e97bc8dc6060479fe4188e1a953c1e Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 15 Jun 2024 15:21:10 +0200 Subject: [PATCH 077/323] fix(edgy): neo-tree. See #3667 --- lua/lazyvim/plugins/extras/ui/edgy.lua | 35 +++++++++++--------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/lua/lazyvim/plugins/extras/ui/edgy.lua b/lua/lazyvim/plugins/extras/ui/edgy.lua index e8708b16..95b2ccf1 100644 --- a/lua/lazyvim/plugins/extras/ui/edgy.lua +++ b/lua/lazyvim/plugins/extras/ui/edgy.lua @@ -96,28 +96,21 @@ return { } -- only add neo-tree sources if they are enabled in config - if vim.list_contains(LazyVim.opts("neo-tree").sources, "buffers") then - table.insert(opts.left, 3, { - title = "Neo-Tree Buffers", - ft = "neo-tree", - filter = function(buf) - return vim.b[buf].neo_tree_source == "buffers" - end, - pinned = true, - open = "Neotree position=top buffers", - }) - end + local neotree_opts = LazyVim.opts("neo-tree.nvim") + local neotree_sources = { buffers = "top", git_status = "right" } - if vim.list_contains(LazyVim.opts("neo-tree").sources, "git_status") then - table.insert(opts.left, 3, { - title = "Neo-Tree Git", - ft = "neo-tree", - filter = function(buf) - return vim.b[buf].neo_tree_source == "git_status" - end, - pinned = true, - open = "Neotree position=right git_status", - }) + for source, pos in pairs(neotree_sources) do + if vim.list_contains(neotree_opts.sources, source) then + table.insert(opts.left, 3, { + 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 for _, pos in ipairs({ "top", "bottom", "left", "right" }) do From d6bea06a82912e324ec86438708e619aaa3adce0 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 15 Jun 2024 18:51:21 +0200 Subject: [PATCH 078/323] feat(mini.pairs): allow to skip pairs in certain treesitter nodes --- lua/lazyvim/util/mini.lua | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/lua/lazyvim/util/mini.lua b/lua/lazyvim/util/mini.lua index 986a1887..a3522434 100644 --- a/lua/lazyvim/util/mini.lua +++ b/lua/lazyvim/util/mini.lua @@ -109,4 +109,40 @@ function M.ai_whichkey() }) end +---@param opts {skip_next: string, skip_ts: string[], skip_unbalanced: boolean, markdown: boolean} +function M.pairs(opts) + local pairs = require("mini.pairs") + pairs.setup(opts) + local open = pairs.open + pairs.open = function(pair, neigh_pattern) + local o, c = pair:sub(1, 1), pair:sub(2, 2) + local line = vim.api.nvim_get_current_line() + local cursor = vim.api.nvim_win_get_cursor(0) + local next = line:sub(cursor[2] + 1, cursor[2] + 1) + local before = line:sub(1, cursor[2]) + if opts.markdown and o == "`" and vim.bo.filetype == "markdown" and before:match("^%s*``") then + return "`\n```" .. vim.api.nvim_replace_termcodes("", true, true, true) + end + if opts.skip_next and next ~= "" and next:match(opts.skip_next) then + return o + end + if opts.skip_ts and #opts.skip_ts > 0 then + local ok, captures = pcall(vim.treesitter.get_captures_at_pos, 0, cursor[1] - 1, math.max(cursor[2] - 1, 0)) + for _, capture in ipairs(ok and captures or {}) do + if vim.tbl_contains(opts.skip_ts, capture.capture) then + return o + end + end + end + if opts.skip_unbalanced and next == c and c ~= o then + local _, count_open = line:gsub(vim.pesc(pair:sub(1, 1)), "") + local _, count_close = line:gsub(vim.pesc(pair:sub(2, 2)), "") + if count_close > count_open then + return o + end + end + return open(pair, neigh_pattern) + end +end + return M From 540261d74d2a743f3bff7eb9749cddeea1d29b19 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 15 Jun 2024 18:52:25 +0200 Subject: [PATCH 079/323] feat(mini.pairs): and now the actual code :) --- lua/lazyvim/plugins/coding.lua | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index 39c89a48..b1eb1776 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -144,6 +144,8 @@ return { opts = { -- skip autopair when next character is one of these skip_next = [=[[%w%%%'%[%"%.%`%$]]=], + -- skip autopair when the cursor is inside these treesitter nodes + skip_ts = { "string" }, -- skip autopair when next character is closing pair -- and there are more closing pairs than opening pairs skip_unbalanced = true, @@ -165,30 +167,7 @@ return { }, }, config = function(_, opts) - local pairs = require("mini.pairs") - pairs.setup(opts) - local open = pairs.open - pairs.open = function(pair, neigh_pattern) - local o, c = pair:sub(1, 1), pair:sub(2, 2) - local line = vim.api.nvim_get_current_line() - local cursor = vim.api.nvim_win_get_cursor(0) - local next = line:sub(cursor[2] + 1, cursor[2] + 1) - local before = line:sub(1, cursor[2]) - if opts.markdown and o == "`" and vim.bo.filetype == "markdown" and before:match("^%s*``") then - return "`\n```" .. vim.api.nvim_replace_termcodes("", true, true, true) - end - if opts.skip_next and next ~= "" and next:match(opts.skip_next) then - return o - end - if opts.skip_unbalanced and next == c and c ~= o then - local _, count_open = line:gsub(vim.pesc(pair:sub(1, 1)), "") - local _, count_close = line:gsub(vim.pesc(pair:sub(2, 2)), "") - if count_close > count_open then - return o - end - end - return open(pair, neigh_pattern) - end + LazyVim.mini.pairs(opts) end, }, From eca86924510676667a3868efc512588749f6594e Mon Sep 17 00:00:00 2001 From: Arthur <82575487+arthur-mountain@users.noreply.github.com> Date: Sun, 16 Jun 2024 00:54:39 +0800 Subject: [PATCH 080/323] fix(pick): remove the unused commands attribute (#3673) ## What is this PR for? When we register a picker, such as a Telescope picker or a fzf-lua picker, we use commands within their own picker. For example, we use M.picker.commands instead of M.pick.commands. ## Does this PR fix an existing issue? no ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/util/pick.lua | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lua/lazyvim/util/pick.lua b/lua/lazyvim/util/pick.lua index e8b08e93..e4da432f 100644 --- a/lua/lazyvim/util/pick.lua +++ b/lua/lazyvim/util/pick.lua @@ -20,11 +20,6 @@ local M = setmetatable({}, { ---@type LazyPicker? M.picker = nil ----@type table -M.commands = { - files = "find_files", -} - ---@param picker LazyPicker function M.register(picker) -- this only happens when using :LazyExtras From b87d18cc17300c49bf8bec4b81a3416024a39a21 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 16 Jun 2024 07:13:40 +0200 Subject: [PATCH 081/323] fix(telescope): default to follow=true --- lua/lazyvim/plugins/extras/editor/telescope.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/extras/editor/telescope.lua b/lua/lazyvim/plugins/extras/editor/telescope.lua index faeb16b9..5047f5f6 100644 --- a/lua/lazyvim/plugins/extras/editor/telescope.lua +++ b/lua/lazyvim/plugins/extras/editor/telescope.lua @@ -20,6 +20,7 @@ local picker = { ---@param opts? lazyvim.util.pick.Opts open = function(builtin, opts) opts = opts or {} + opts.follow = opts.follow ~= false if opts.cwd and opts.cwd ~= vim.uv.cwd() then local function open_cwd_dir() local action_state = require("telescope.actions.state") From af5a59be90eb956ef82d5fcfbbd1f602f8fcc3f5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 16 Jun 2024 05:14:20 +0000 Subject: [PATCH 082/323] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index f6b04d72..1c5a01db 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 15 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 16 ============================================================================== Table of Contents *LazyVim-table-of-contents* From f24999fd3645756a338137278ccc4fa3e1240a90 Mon Sep 17 00:00:00 2001 From: xiaojianzheng <1272209235@qq.com> Date: Sun, 16 Jun 2024 13:21:30 +0800 Subject: [PATCH 083/323] feat(project): add some fzf-lua keymap (#3666) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - `ctrl-s` search_in_project_files - `ctrl-w` change_working_directory - `ctrl-d` delete_project - `ctrl-r` recent_project_files Co-authored-by: 肖健正 --- lua/lazyvim/plugins/extras/util/project.lua | 34 ++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/util/project.lua b/lua/lazyvim/plugins/extras/util/project.lua index 7a391c6a..c84b73bb 100644 --- a/lua/lazyvim/plugins/extras/util/project.lua +++ b/lua/lazyvim/plugins/extras/util/project.lua @@ -1,11 +1,15 @@ -local pick = function() +local pick = nil + +pick = function() if LazyVim.pick.picker.name == "telescope" then return vim.cmd("Telescope projects") elseif LazyVim.pick.picker.name == "fzf" then local fzf_lua = require("fzf-lua") + local project = require("project_nvim.project") local history = require("project_nvim.utils.history") local results = history.get_recent_projects() local actions = require("fzf-lua.actions") + fzf_lua.fzf_exec(results, { actions = { ["default"] = { @@ -14,6 +18,34 @@ local pick = function() end, }, ["ctrl-t"] = actions.file_tabedit, + ["ctrl-s"] = { + function(selected) + fzf_lua.live_grep({ cwd = selected[1] }) + end, + }, + ["ctrl-r"] = { + function(selected) + fzf_lua.oldfiles({ cwd = selected[1] }) + end, + }, + ["ctrl-w"] = { + function(selected) + local path = selected[1] + local ok = project.set_pwd(path) + if ok then + vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("", true, false, true), "n", true) + LazyVim.info("Change project dir to " .. path) + end + end, + }, + ["ctrl-d"] = function(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 From cda30f2740f0479098e93a546a741aeefad535cc Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 16 Jun 2024 09:06:12 +0200 Subject: [PATCH 084/323] feat(fzf): basic image viewing support --- lua/lazyvim/plugins/extras/editor/fzf.lua | 24 +++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/lua/lazyvim/plugins/extras/editor/fzf.lua b/lua/lazyvim/plugins/extras/editor/fzf.lua index 4516a64b..b92a4037 100644 --- a/lua/lazyvim/plugins/extras/editor/fzf.lua +++ b/lua/lazyvim/plugins/extras/editor/fzf.lua @@ -84,6 +84,18 @@ return { end fix(defaults) + local img_previewer ---@type string[]? + for _, v in ipairs({ + { cmd = "ueberzug", args = {} }, + { cmd = "chafa", args = { "{file}", "--format=symbols" } }, + { cmd = "viu", args = { "-b" } }, + }) do + if vim.fn.executable(v.cmd) == 1 then + img_previewer = vim.list_extend({ v.cmd }, v.args) + break + end + end + return vim.tbl_deep_extend("force", defaults, { fzf_colors = true, fzf_opts = { @@ -93,6 +105,18 @@ return { -- formatter = "path.filename_first", formatter = "path.dirname_first", }, + previewers = { + builtin = { + extensions = { + ["png"] = img_previewer, + ["jpg"] = img_previewer, + ["jpeg"] = img_previewer, + ["gif"] = img_previewer, + ["webp"] = img_previewer, + }, + ueberzug_scaler = "fit_contain", + }, + }, -- Custom LazyVim option to configure vim.ui.select ui_select = function(fzf_opts, items) return vim.tbl_deep_extend("force", fzf_opts, { From 71390adcbe0252f364e02c4dd5ade6d86686c0b8 Mon Sep 17 00:00:00 2001 From: dotfrag <17456867+dotfrag@users.noreply.github.com> Date: Sun, 16 Jun 2024 10:06:53 +0300 Subject: [PATCH 085/323] refactor(util): use available get_plugin() function (#3687) ## What is this PR for? Small refactor to use the already available `get_plugin()` function. ## Does this PR fix an existing issue? No. ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/util/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/util/init.lua b/lua/lazyvim/util/init.lua index 47efa485..106cbdc0 100644 --- a/lua/lazyvim/util/init.lua +++ b/lua/lazyvim/util/init.lua @@ -117,7 +117,7 @@ end ---@param name string function M.opts(name) - local plugin = require("lazy.core.config").spec.plugins[name] + local plugin = M.get_plugin(name) if not plugin then return {} end From 2daca4b51014a1a14ce8a5ccdd9fdf08a51db3db Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 16 Jun 2024 10:33:20 +0200 Subject: [PATCH 086/323] feat(mini.pairs): enable mini.pairs in the cmdline --- lua/lazyvim/plugins/coding.lua | 1 + lua/lazyvim/util/mini.lua | 3 +++ 2 files changed, 4 insertions(+) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index b1eb1776..d1fc5a22 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -142,6 +142,7 @@ return { "echasnovski/mini.pairs", event = "VeryLazy", opts = { + modes = { insert = true, command = true, terminal = false }, -- skip autopair when next character is one of these skip_next = [=[[%w%%%'%[%"%.%`%$]]=], -- skip autopair when the cursor is inside these treesitter nodes diff --git a/lua/lazyvim/util/mini.lua b/lua/lazyvim/util/mini.lua index a3522434..a0fe407b 100644 --- a/lua/lazyvim/util/mini.lua +++ b/lua/lazyvim/util/mini.lua @@ -115,6 +115,9 @@ function M.pairs(opts) pairs.setup(opts) local open = pairs.open pairs.open = function(pair, neigh_pattern) + if vim.fn.getcmdline() ~= "" then + return open(pair, neigh_pattern) + end local o, c = pair:sub(1, 1), pair:sub(2, 2) local line = vim.api.nvim_get_current_line() local cursor = vim.api.nvim_win_get_cursor(0) From 31c2ad7dac2e711018b3e1393c5b995515b2ef5e Mon Sep 17 00:00:00 2001 From: xiaojianzheng <1272209235@qq.com> Date: Sun, 16 Jun 2024 16:48:18 +0800 Subject: [PATCH 087/323] feat(outline): free ctrl-k /ctrl+j (#3686) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allows to toggle window in outline using Ctrl-k /ctrl+j Co-authored-by: 肖健正 --- lua/lazyvim/plugins/extras/editor/outline.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/lazyvim/plugins/extras/editor/outline.lua b/lua/lazyvim/plugins/extras/editor/outline.lua index 07c46705..abc4e6c0 100644 --- a/lua/lazyvim/plugins/extras/editor/outline.lua +++ b/lua/lazyvim/plugins/extras/editor/outline.lua @@ -17,6 +17,10 @@ return { local opts = { symbols = {}, symbol_blacklist = {}, + keymaps = { + up_and_jump = "", + down_and_jump = "", + }, } local filter = Config.kind_filter From 32b2574c1be21176b604a9210a77d3b5b446f0e0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 16 Jun 2024 11:02:02 +0200 Subject: [PATCH 088/323] chore(main): release 12.16.0 (#3671) :robot: I have created a release *beep* *boop* --- ## [12.16.0](https://github.com/LazyVim/LazyVim/compare/v12.15.0...v12.16.0) (2024-06-16) ### Features * **fzf:** basic image viewing support ([cda30f2](https://github.com/LazyVim/LazyVim/commit/cda30f2740f0479098e93a546a741aeefad535cc)) * **mini.pairs:** allow to skip pairs in certain treesitter nodes ([d6bea06](https://github.com/LazyVim/LazyVim/commit/d6bea06a82912e324ec86438708e619aaa3adce0)) * **mini.pairs:** and now the actual code :) ([540261d](https://github.com/LazyVim/LazyVim/commit/540261d74d2a743f3bff7eb9749cddeea1d29b19)) * **mini.pairs:** enable mini.pairs in the cmdline ([2daca4b](https://github.com/LazyVim/LazyVim/commit/2daca4b51014a1a14ce8a5ccdd9fdf08a51db3db)) * **outline:** free ctrl-k /ctrl+j ([#3686](https://github.com/LazyVim/LazyVim/issues/3686)) ([31c2ad7](https://github.com/LazyVim/LazyVim/commit/31c2ad7dac2e711018b3e1393c5b995515b2ef5e)) * **project:** add some fzf-lua keymap ([#3666](https://github.com/LazyVim/LazyVim/issues/3666)) ([f24999f](https://github.com/LazyVim/LazyVim/commit/f24999fd3645756a338137278ccc4fa3e1240a90)) ### Bug Fixes * **edgy:** neo-tree. See [#3667](https://github.com/LazyVim/LazyVim/issues/3667) ([f22a602](https://github.com/LazyVim/LazyVim/commit/f22a6022c4e97bc8dc6060479fe4188e1a953c1e)) * **egdy:** do not add panes for not enabled neo-tree sources ([#3667](https://github.com/LazyVim/LazyVim/issues/3667)) ([67616b9](https://github.com/LazyVim/LazyVim/commit/67616b9520a5309d2e3565ff880b37ceef662179)) * **pick:** remove the unused commands attribute ([#3673](https://github.com/LazyVim/LazyVim/issues/3673)) ([eca8692](https://github.com/LazyVim/LazyVim/commit/eca86924510676667a3868efc512588749f6594e)) * **telescope:** default to follow=true ([b87d18c](https://github.com/LazyVim/LazyVim/commit/b87d18cc17300c49bf8bec4b81a3416024a39a21)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa284f73..e4d07691 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog +## [12.16.0](https://github.com/LazyVim/LazyVim/compare/v12.15.0...v12.16.0) (2024-06-16) + + +### Features + +* **fzf:** basic image viewing support ([cda30f2](https://github.com/LazyVim/LazyVim/commit/cda30f2740f0479098e93a546a741aeefad535cc)) +* **mini.pairs:** allow to skip pairs in certain treesitter nodes ([d6bea06](https://github.com/LazyVim/LazyVim/commit/d6bea06a82912e324ec86438708e619aaa3adce0)) +* **mini.pairs:** and now the actual code :) ([540261d](https://github.com/LazyVim/LazyVim/commit/540261d74d2a743f3bff7eb9749cddeea1d29b19)) +* **mini.pairs:** enable mini.pairs in the cmdline ([2daca4b](https://github.com/LazyVim/LazyVim/commit/2daca4b51014a1a14ce8a5ccdd9fdf08a51db3db)) +* **outline:** free ctrl-k /ctrl+j ([#3686](https://github.com/LazyVim/LazyVim/issues/3686)) ([31c2ad7](https://github.com/LazyVim/LazyVim/commit/31c2ad7dac2e711018b3e1393c5b995515b2ef5e)) +* **project:** add some fzf-lua keymap ([#3666](https://github.com/LazyVim/LazyVim/issues/3666)) ([f24999f](https://github.com/LazyVim/LazyVim/commit/f24999fd3645756a338137278ccc4fa3e1240a90)) + + +### Bug Fixes + +* **edgy:** neo-tree. See [#3667](https://github.com/LazyVim/LazyVim/issues/3667) ([f22a602](https://github.com/LazyVim/LazyVim/commit/f22a6022c4e97bc8dc6060479fe4188e1a953c1e)) +* **egdy:** do not add panes for not enabled neo-tree sources ([#3667](https://github.com/LazyVim/LazyVim/issues/3667)) ([67616b9](https://github.com/LazyVim/LazyVim/commit/67616b9520a5309d2e3565ff880b37ceef662179)) +* **pick:** remove the unused commands attribute ([#3673](https://github.com/LazyVim/LazyVim/issues/3673)) ([eca8692](https://github.com/LazyVim/LazyVim/commit/eca86924510676667a3868efc512588749f6594e)) +* **telescope:** default to follow=true ([b87d18c](https://github.com/LazyVim/LazyVim/commit/b87d18cc17300c49bf8bec4b81a3416024a39a21)) + ## [12.15.0](https://github.com/LazyVim/LazyVim/compare/v12.14.1...v12.15.0) (2024-06-15) From 0d57115f01b4094f68e426942e14892f204ec664 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 16 Jun 2024 15:17:45 +0200 Subject: [PATCH 089/323] fix(lsp): dont highlight document words when cmp is visible --- lua/lazyvim/util/cmp.lua | 5 +++++ lua/lazyvim/util/lsp.lua | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/util/cmp.lua b/lua/lazyvim/util/cmp.lua index e4a7f700..6a0e0b13 100644 --- a/lua/lazyvim/util/cmp.lua +++ b/lua/lazyvim/util/cmp.lua @@ -70,6 +70,11 @@ function M.add_missing_snippet_docs(window) end end +function M.visible() + local ok, cmp = pcall(require, "cmp") + return ok and cmp.core.view:visible() +end + -- This is a better implementation of `cmp.confirm`: -- * check if the completion menu is visible without waiting for running sources -- * create an undo point before confirming diff --git a/lua/lazyvim/util/lsp.lua b/lua/lazyvim/util/lsp.lua index c01f3c94..59c35314 100644 --- a/lua/lazyvim/util/lsp.lua +++ b/lua/lazyvim/util/lsp.lua @@ -280,10 +280,11 @@ function M.words.setup(opts) if not require("lazyvim.plugins.lsp.keymaps").has(buf, "documentHighlight") then return false end + if not ({ M.words.get() })[2] then if ev.event:find("CursorMoved") then vim.lsp.buf.clear_references() - else + elseif not LazyVim.cmp.visible() then vim.lsp.buf.document_highlight() end end From e2972f0ccaf87c7d75bcd498fa9b2a64eb3d39a5 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 16 Jun 2024 15:17:53 +0200 Subject: [PATCH 090/323] refactor: cmp --- lua/lazyvim/plugins/coding.lua | 39 ++++++---------------------------- lua/lazyvim/util/cmp.lua | 27 +++++++++++++++++++++++ 2 files changed, 34 insertions(+), 32 deletions(-) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index d1fc5a22..e73d904e 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -23,19 +23,19 @@ return { vim.api.nvim_set_hl(0, "CmpGhostText", { link = "Comment", default = true }) local cmp = require("cmp") local defaults = require("cmp.config.default")() + local auto_select = true return { auto_brackets = {}, -- configure any filetype to auto add brackets completion = { - completeopt = "menu,menuone,noinsert", + completeopt = "menu,menuone,noinsert" .. (auto_select and "" or ",noselect"), }, + preselect = auto_select and cmp.PreselectMode.Item or cmp.PreselectMode.None, mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }), - [""] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }), [""] = cmp.mapping.scroll_docs(-4), [""] = cmp.mapping.scroll_docs(4), [""] = cmp.mapping.complete(), - [""] = cmp.mapping.abort(), - [""] = LazyVim.cmp.confirm(), + [""] = LazyVim.cmp.confirm({ select = auto_select }), + [""] = LazyVim.cmp.confirm({ select = true }), [""] = LazyVim.cmp.confirm({ behavior = cmp.ConfirmBehavior.Replace }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. [""] = function(fallback) cmp.abort() @@ -50,7 +50,7 @@ return { }), formatting = { format = function(_, item) - local icons = require("lazyvim.config").icons.kinds + local icons = LazyVim.config.icons.kinds if icons[item.kind] then item.kind = icons[item.kind] .. item.kind end @@ -65,32 +65,7 @@ return { sorting = defaults.sorting, } end, - ---@param opts cmp.ConfigSchema | {auto_brackets?: string[]} - config = function(_, opts) - for _, source in ipairs(opts.sources) do - source.group_index = source.group_index or 1 - end - - local parse = require("cmp.utils.snippet").parse - require("cmp.utils.snippet").parse = function(input) - local ok, ret = pcall(parse, input) - if ok then - return ret - end - return LazyVim.cmp.snippet_preview(input) - end - - local cmp = require("cmp") - cmp.setup(opts) - cmp.event:on("confirm_done", function(event) - if vim.tbl_contains(opts.auto_brackets or {}, vim.bo.filetype) then - LazyVim.cmp.auto_brackets(event.entry) - end - end) - cmp.event:on("menu_opened", function(event) - LazyVim.cmp.add_missing_snippet_docs(event.window) - end) - end, + main = "lazyvim.util.cmp", }, -- snippets diff --git a/lua/lazyvim/util/cmp.lua b/lua/lazyvim/util/cmp.lua index 6a0e0b13..242d5960 100644 --- a/lua/lazyvim/util/cmp.lua +++ b/lua/lazyvim/util/cmp.lua @@ -128,4 +128,31 @@ function M.expand(snippet) end end +---@param opts cmp.ConfigSchema | {auto_brackets?: string[]} +function M.setup(opts) + for _, source in ipairs(opts.sources) do + source.group_index = source.group_index or 1 + end + + local parse = require("cmp.utils.snippet").parse + require("cmp.utils.snippet").parse = function(input) + local ok, ret = pcall(parse, input) + if ok then + return ret + end + return LazyVim.cmp.snippet_preview(input) + end + + local cmp = require("cmp") + cmp.setup(opts) + cmp.event:on("confirm_done", function(event) + if vim.tbl_contains(opts.auto_brackets or {}, vim.bo.filetype) then + LazyVim.cmp.auto_brackets(event.entry) + end + end) + cmp.event:on("menu_opened", function(event) + LazyVim.cmp.add_missing_snippet_docs(event.window) + end) +end + return M From 57ef349910ec40c7024f3b50a549aabefa1ebbf0 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 16 Jun 2024 15:30:44 +0200 Subject: [PATCH 091/323] fix(cmp): visible --- lua/lazyvim/util/cmp.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/util/cmp.lua b/lua/lazyvim/util/cmp.lua index 242d5960..8cb3d1bc 100644 --- a/lua/lazyvim/util/cmp.lua +++ b/lua/lazyvim/util/cmp.lua @@ -71,8 +71,9 @@ function M.add_missing_snippet_docs(window) end function M.visible() - local ok, cmp = pcall(require, "cmp") - return ok and cmp.core.view:visible() + ---@module 'cmp' + local cmp = package.loaded["cmp"] + return cmp and cmp.core.view:visible() end -- This is a better implementation of `cmp.confirm`: From 05e45e0d35b7308bd16cd7486768a79aa4b0c1db Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 16 Jun 2024 15:35:38 +0200 Subject: [PATCH 092/323] refactor: LazyVim.config --- lua/lazyvim/plugins/extras/coding/copilot.lua | 2 +- lua/lazyvim/plugins/extras/coding/tabnine.lua | 2 +- lua/lazyvim/plugins/extras/editor/aerial.lua | 8 +++----- lua/lazyvim/plugins/extras/editor/fzf.lua | 2 +- lua/lazyvim/plugins/extras/editor/navic.lua | 2 +- lua/lazyvim/plugins/extras/editor/outline.lua | 5 ++--- lua/lazyvim/plugins/extras/editor/telescope.lua | 4 ++-- lua/lazyvim/plugins/lsp/init.lua | 2 +- lua/lazyvim/plugins/ui.lua | 4 ++-- lua/lazyvim/plugins/xtras.lua | 4 +--- lua/lazyvim/util/extras.lua | 11 +++++------ lua/lazyvim/util/json.lua | 10 ++++------ lua/lazyvim/util/lualine.lua | 2 +- lua/lazyvim/util/news.lua | 14 ++++++-------- lua/lazyvim/util/ui.lua | 2 +- 15 files changed, 32 insertions(+), 42 deletions(-) diff --git a/lua/lazyvim/plugins/extras/coding/copilot.lua b/lua/lazyvim/plugins/extras/coding/copilot.lua index a9897107..8f0680ea 100644 --- a/lua/lazyvim/plugins/extras/coding/copilot.lua +++ b/lua/lazyvim/plugins/extras/coding/copilot.lua @@ -27,7 +27,7 @@ return { } table.insert(opts.sections.lualine_x, 2, { function() - local icon = require("lazyvim.config").icons.kinds.Copilot + local icon = LazyVim.config.icons.kinds.Copilot local status = require("copilot.api").status.data return icon .. (status.message or "") end, diff --git a/lua/lazyvim/plugins/extras/coding/tabnine.lua b/lua/lazyvim/plugins/extras/coding/tabnine.lua index a255120e..f02fccc9 100644 --- a/lua/lazyvim/plugins/extras/coding/tabnine.lua +++ b/lua/lazyvim/plugins/extras/coding/tabnine.lua @@ -42,7 +42,7 @@ return { optional = true, event = "VeryLazy", opts = function(_, opts) - local icon = require("lazyvim.config").icons.kinds.TabNine + local icon = LazyVim.config.icons.kinds.TabNine table.insert(opts.sections.lualine_x, 2, LazyVim.lualine.cmp_source("cmp_tabnine", icon)) end, }, diff --git a/lua/lazyvim/plugins/extras/editor/aerial.lua b/lua/lazyvim/plugins/extras/editor/aerial.lua index ad527aae..d2486c22 100644 --- a/lua/lazyvim/plugins/extras/editor/aerial.lua +++ b/lua/lazyvim/plugins/extras/editor/aerial.lua @@ -1,12 +1,10 @@ -local Config = require("lazyvim.config") - return { desc = "Aerial Symbol Browser", { "stevearc/aerial.nvim", event = "LazyFile", opts = function() - local icons = vim.deepcopy(Config.icons.kinds) + local icons = vim.deepcopy(LazyVim.config.icons.kinds) -- HACK: fix lua's weird choice for `Package` for control -- structures like if/else/for/etc. @@ -14,8 +12,8 @@ return { ---@type table|false local filter_kind = false - if Config.kind_filter then - filter_kind = assert(vim.deepcopy(Config.kind_filter)) + if LazyVim.config.kind_filter then + filter_kind = assert(vim.deepcopy(LazyVim.config.kind_filter)) filter_kind._ = filter_kind.default filter_kind.default = nil end diff --git a/lua/lazyvim/plugins/extras/editor/fzf.lua b/lua/lazyvim/plugins/extras/editor/fzf.lua index b92a4037..8a0a2927 100644 --- a/lua/lazyvim/plugins/extras/editor/fzf.lua +++ b/lua/lazyvim/plugins/extras/editor/fzf.lua @@ -30,7 +30,7 @@ end local function symbols_filter(entry, ctx) if ctx.symbols_filter == nil then - ctx.symbols_filter = require("lazyvim.config").get_kind_filter(ctx.bufnr) or false + ctx.symbols_filter = LazyVim.config.get_kind_filter(ctx.bufnr) or false end if ctx.symbols_filter == false then return true diff --git a/lua/lazyvim/plugins/extras/editor/navic.lua b/lua/lazyvim/plugins/extras/editor/navic.lua index e89bc11f..642a4a99 100644 --- a/lua/lazyvim/plugins/extras/editor/navic.lua +++ b/lua/lazyvim/plugins/extras/editor/navic.lua @@ -18,7 +18,7 @@ return { separator = " ", highlight = true, depth_limit = 5, - icons = require("lazyvim.config").icons.kinds, + icons = LazyVim.config.icons.kinds, lazy_update_context = true, } end, diff --git a/lua/lazyvim/plugins/extras/editor/outline.lua b/lua/lazyvim/plugins/extras/editor/outline.lua index abc4e6c0..575d6ec6 100644 --- a/lua/lazyvim/plugins/extras/editor/outline.lua +++ b/lua/lazyvim/plugins/extras/editor/outline.lua @@ -12,7 +12,6 @@ return { keys = { { "cs", "Outline", desc = "Toggle Outline" } }, cmd = "Outline", opts = function() - local Config = require("lazyvim.config") local defaults = require("outline.config").defaults local opts = { symbols = {}, @@ -22,14 +21,14 @@ return { down_and_jump = "", }, } - local filter = Config.kind_filter + local filter = LazyVim.config.kind_filter if type(filter) == "table" then filter = filter.default if type(filter) == "table" then for kind, symbol in pairs(defaults.symbols) do opts.symbols[kind] = { - icon = Config.icons.kinds[kind] or symbol.icon, + icon = LazyVim.config.icons.kinds[kind] or symbol.icon, hl = symbol.hl, } if not vim.tbl_contains(filter, kind) then diff --git a/lua/lazyvim/plugins/extras/editor/telescope.lua b/lua/lazyvim/plugins/extras/editor/telescope.lua index 5047f5f6..9d40dcdf 100644 --- a/lua/lazyvim/plugins/extras/editor/telescope.lua +++ b/lua/lazyvim/plugins/extras/editor/telescope.lua @@ -133,7 +133,7 @@ return { "ss", function() require("telescope.builtin").lsp_document_symbols({ - symbols = require("lazyvim.config").get_kind_filter(), + symbols = LazyVim.config.get_kind_filter(), }) end, desc = "Goto Symbol", @@ -142,7 +142,7 @@ return { "sS", function() require("telescope.builtin").lsp_dynamic_workspace_symbols({ - symbols = require("lazyvim.config").get_kind_filter(), + symbols = LazyVim.config.get_kind_filter(), }) end, desc = "Goto Symbol (Workspace)", diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index de3ecc80..fceb3055 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -170,7 +170,7 @@ return { if type(opts.diagnostics.virtual_text) == "table" and opts.diagnostics.virtual_text.prefix == "icons" then opts.diagnostics.virtual_text.prefix = vim.fn.has("nvim-0.10.0") == 0 and "●" or function(diagnostic) - local icons = require("lazyvim.config").icons.diagnostics + local icons = LazyVim.config.icons.diagnostics for d, icon in pairs(icons) do if diagnostic.severity == vim.diagnostic.severity[d:upper()] then return icon diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index 384ec590..8adb760c 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -61,7 +61,7 @@ return { diagnostics = "nvim_lsp", always_show_bufferline = false, diagnostics_indicator = function(_, _, diag) - local icons = require("lazyvim.config").icons.diagnostics + local icons = LazyVim.config.icons.diagnostics local ret = (diag.error and icons.Error .. diag.error .. " " or "") .. (diag.warning and icons.Warn .. diag.warning or "") return vim.trim(ret) @@ -112,7 +112,7 @@ return { local lualine_require = require("lualine_require") lualine_require.require = require - local icons = require("lazyvim.config").icons + local icons = LazyVim.config.icons vim.o.laststatus = vim.g.lualine_laststatus diff --git a/lua/lazyvim/plugins/xtras.lua b/lua/lazyvim/plugins/xtras.lua index 24d5fcd2..761569c5 100644 --- a/lua/lazyvim/plugins/xtras.lua +++ b/lua/lazyvim/plugins/xtras.lua @@ -1,5 +1,3 @@ -local Config = require("lazyvim.config") - -- Some extras need to be loaded before others local prios = { ["lazyvim.plugins.extras.test.core"] = 1, @@ -13,7 +11,7 @@ local prios = { } ---@type string[] -local extras = LazyVim.dedup(Config.json.data.extras) +local extras = LazyVim.dedup(LazyVim.config.json.data.extras) local version = vim.version() local v = version.major .. "_" .. version.minor diff --git a/lua/lazyvim/util/extras.lua b/lua/lazyvim/util/extras.lua index 2fdef824..07cb27e0 100644 --- a/lua/lazyvim/util/extras.lua +++ b/lua/lazyvim/util/extras.lua @@ -1,4 +1,3 @@ -local Config = require("lazyvim.config") local Float = require("lazy.view.float") local LazyConfig = require("lazy.core.config") local Plugin = require("lazy.core.plugin") @@ -124,7 +123,7 @@ function M.get_extra(source, modname) imports = imports, desc = require(modname).desc, recommended = recommended, - managed = vim.tbl_contains(Config.json.data.extras, modname) or not enabled, + managed = vim.tbl_contains(LazyVim.config.json.data.extras, modname) or not enabled, plugins = plugins, optional = optional, } @@ -169,17 +168,17 @@ function X:toggle() return end extra.enabled = not extra.enabled - Config.json.data.extras = vim.tbl_filter(function(name) + LazyVim.config.json.data.extras = vim.tbl_filter(function(name) return name ~= extra.module - end, Config.json.data.extras) + end, LazyVim.config.json.data.extras) M.state = vim.tbl_filter(function(name) return name ~= extra.module end, M.state) if extra.enabled then - table.insert(Config.json.data.extras, extra.module) + table.insert(LazyVim.config.json.data.extras, extra.module) M.state[#M.state + 1] = extra.module end - table.sort(Config.json.data.extras) + table.sort(LazyVim.config.json.data.extras) LazyVim.json.save() LazyVim.info( "`" diff --git a/lua/lazyvim/util/json.lua b/lua/lazyvim/util/json.lua index 60466a45..3abdad75 100644 --- a/lua/lazyvim/util/json.lua +++ b/lua/lazyvim/util/json.lua @@ -1,5 +1,3 @@ -local Config = require("lazyvim.config") - ---@class lazyvim.util.json local M = {} @@ -46,18 +44,18 @@ function M.encode(value) end function M.save() - Config.json.data.version = Config.json.version + LazyVim.config.json.data.version = LazyVim.config.json.version local path = vim.fn.stdpath("config") .. "/lazyvim.json" local f = io.open(path, "w") if f then - f:write(LazyVim.json.encode(Config.json.data)) + f:write(LazyVim.json.encode(LazyVim.config.json.data)) f:close() end end function M.migrate() - LazyVim.info("Migrating `lazyvim.json` to version `" .. Config.json.version .. "`") - local json = Config.json + LazyVim.info("Migrating `lazyvim.json` to version `" .. LazyVim.config.json.version .. "`") + local json = LazyVim.config.json -- v0 if not json.data.version then diff --git a/lua/lazyvim/util/lualine.lua b/lua/lazyvim/util/lualine.lua index aad22677..6284504a 100644 --- a/lua/lazyvim/util/lualine.lua +++ b/lua/lazyvim/util/lualine.lua @@ -30,7 +30,7 @@ function M.cmp_source(name, icon) return { function() - return icon or require("lazyvim.config").icons.kinds[name:sub(1, 1):upper() .. name:sub(2)] + return icon or LazyVim.config.icons.kinds[name:sub(1, 1):upper() .. name:sub(2)] end, cond = function() return status() ~= nil diff --git a/lua/lazyvim/util/news.lua b/lua/lazyvim/util/news.lua index 5434649a..d1a6b44b 100644 --- a/lua/lazyvim/util/news.lua +++ b/lua/lazyvim/util/news.lua @@ -1,5 +1,3 @@ -local Config = require("lazyvim.config") - ---@class lazyvim.util.news local M = {} @@ -13,13 +11,13 @@ end function M.setup() vim.schedule(function() - if Config.news.lazyvim then - if not Config.json.data.news["NEWS.md"] then + if LazyVim.config.news.lazyvim then + if not LazyVim.config.json.data.news["NEWS.md"] then M.welcome() end M.lazyvim(true) end - if Config.news.neovim then + if LazyVim.config.news.neovim then M.neovim(true) end end) @@ -61,12 +59,12 @@ function M.open(file, opts) end if opts.when_changed then - local is_new = not Config.json.data.news[ref] + local is_new = not LazyVim.config.json.data.news[ref] local hash = M.hash(file) - if hash == Config.json.data.news[ref] then + if hash == LazyVim.config.json.data.news[ref] then return end - Config.json.data.news[ref] = hash + LazyVim.config.json.data.news[ref] = hash LazyVim.json.save() -- don't open if file has never been opened if is_new then diff --git a/lua/lazyvim/util/ui.lua b/lua/lazyvim/util/ui.lua index 84ab8ab5..1ad2b6f0 100644 --- a/lua/lazyvim/util/ui.lua +++ b/lua/lazyvim/util/ui.lua @@ -78,7 +78,7 @@ function M.foldtext() if not ret or type(ret) == "string" then ret = { { vim.api.nvim_buf_get_lines(0, vim.v.lnum - 1, vim.v.lnum, false)[1], {} } } end - table.insert(ret, { " " .. require("lazyvim.config").icons.misc.dots }) + table.insert(ret, { " " .. LazyVim.config.icons.misc.dots }) if not vim.treesitter.foldtext then return table.concat( From 18c7731281f7a9886ae98d9c034661fa85340fb2 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 16 Jun 2024 19:18:32 +0200 Subject: [PATCH 093/323] feat(treesitter-textobjects): added ]a and [a to move between parameters --- lua/lazyvim/plugins/treesitter.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lua/lazyvim/plugins/treesitter.lua b/lua/lazyvim/plugins/treesitter.lua index 2c4ee5b2..7bd2d091 100644 --- a/lua/lazyvim/plugins/treesitter.lua +++ b/lua/lazyvim/plugins/treesitter.lua @@ -66,10 +66,10 @@ return { textobjects = { move = { enable = true, - goto_next_start = { ["]f"] = "@function.outer", ["]c"] = "@class.outer" }, - goto_next_end = { ["]F"] = "@function.outer", ["]C"] = "@class.outer" }, - goto_previous_start = { ["[f"] = "@function.outer", ["[c"] = "@class.outer" }, - goto_previous_end = { ["[F"] = "@function.outer", ["[C"] = "@class.outer" }, + goto_next_start = { ["]f"] = "@function.outer", ["]c"] = "@class.outer", ["]a"] = "@parameter.inner" }, + goto_next_end = { ["]F"] = "@function.outer", ["]C"] = "@class.outer", ["]A"] = "@parameter.inner" }, + goto_previous_start = { ["[f"] = "@function.outer", ["[c"] = "@class.outer", ["[a"] = "@parameter.inner" }, + goto_previous_end = { ["[F"] = "@function.outer", ["[C"] = "@class.outer", ["[A"] = "@parameter.inner" }, }, }, }, From 0fcadced89f96f59a9f9cb0c85ee73990df1219f Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 16 Jun 2024 20:17:10 +0200 Subject: [PATCH 094/323] feat(copilot-chat): ctrl-s now works in both normal and insert mode --- lua/lazyvim/plugins/extras/coding/copilot-chat.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/extras/coding/copilot-chat.lua b/lua/lazyvim/plugins/extras/coding/copilot-chat.lua index 2db98a8c..7eb2d666 100644 --- a/lua/lazyvim/plugins/extras/coding/copilot-chat.lua +++ b/lua/lazyvim/plugins/extras/coding/copilot-chat.lua @@ -38,6 +38,7 @@ return { } end, keys = { + { "", "", ft = "copilot-chat", desc = "Submit Prompt", remap = true }, { "a", "", desc = "+ai", mode = { "n", "v" } }, { "aa", From ea3b5cc2ab4ff7d70163ab66ea7fa0acc0e88566 Mon Sep 17 00:00:00 2001 From: Tony Messias Date: Mon, 17 Jun 2024 01:47:47 -0300 Subject: [PATCH 095/323] feat(php): allow using intelephense instead of phpactor in php extras (#3691) ## What is this PR for? - Allows setting intelephense instead of phpactor for PHP's LSP ## Does this PR fix an existing issue? No. But I personally use intelephesen myself and when researching on how to use the PHP extras but swap phpactor (too verbose, imo) for intelephense, I found this [comment here](https://github.com/LazyVim/LazyVim/pull/3397#issuecomment-2141950186) which suggested making it configurable like the Python extras. That's what I'm doing here. ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/lang/php.lua | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/php.lua b/lua/lazyvim/plugins/extras/lang/php.lua index 3b66b583..e0809729 100644 --- a/lua/lazyvim/plugins/extras/lang/php.lua +++ b/lua/lazyvim/plugins/extras/lang/php.lua @@ -1,3 +1,11 @@ +if lazyvim_docs then + -- LSP Server to use for PHP. + -- Set to "intelephense" to use intelephense instead of phpactor. + vim.g.lazyvim_php_lsp = "intelephense" +end + +local lsp = vim.g.lazyvim_php_lsp or "phpactor" + return { recommended = { ft = "php", @@ -13,7 +21,15 @@ return { "neovim/nvim-lspconfig", opts = { servers = { - phpactor = {}, + phpactor = { + enabled = lsp == "phpactor", + }, + intelephense = { + enabled = lsp == "intelephense", + }, + [lsp] = { + enabled = true, + }, }, }, }, From 9177c3ad5e5a419e24c5d7b09c952f0566145624 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 17 Jun 2024 04:48:26 +0000 Subject: [PATCH 096/323] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 1c5a01db..0b8c788b 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 16 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 17 ============================================================================== Table of Contents *LazyVim-table-of-contents* From a69e626d7a3a027df124bae7b2672658a4fb5b0f Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Mon, 17 Jun 2024 20:49:30 +0300 Subject: [PATCH 097/323] fix(conform): `lsp_format` breaking changes (#3707) ## What is this PR for? `conform.nvim` had breaking changes, that renamed `lsp_fallback` to `lsp_format` as can be seen [here](https://github.com/stevearc/conform.nvim/commit/9228b2ff4efd58b6e081defec643bf887ebadff6) ## Does this PR fix an existing issue? Fixes #3706 ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/formatting.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/formatting.lua b/lua/lazyvim/plugins/formatting.lua index 0935f6b3..f4160b4d 100644 --- a/lua/lazyvim/plugins/formatting.lua +++ b/lua/lazyvim/plugins/formatting.lua @@ -66,7 +66,7 @@ return { timeout_ms = 3000, async = false, -- not recommended to change quiet = false, -- not recommended to change - lsp_fallback = true, -- not recommended to change + lsp_format = "fallback", -- not recommended to change }, ---@type table formatters_by_ft = { From 1f034e16000692d1d0ec8e02110d37cf2089bd4c Mon Sep 17 00:00:00 2001 From: morland Date: Tue, 18 Jun 2024 03:52:40 +1000 Subject: [PATCH 098/323] fix(lazygit): support monorepo structure and other git providers (#3701) ## What is this PR for? - The current implementation doesn't support multi-module/monorepo project where `/.git` can be `gitdir` alias to the main `.git` folder. This PR uses the Git CLI to resolve remote URLs to better support flexible project structure. - This PR also adds the support to Bitbucket and GitLab What's the problem of reading `.git/config`? - Not all information available there. For instance, some large projects will split a monorepo into smaller submodules, where `.git` is a file that contains the `gitdir` alias. - There's no promise that `.git/config` has to be existed. Git supports multiple ways to store the git info outside of the default git directory like using `GIT_DIR` env variable. - Have to do lot of reading and parsing logic. Why `git remote -v`? - Only contains remote info with explicit format. - Don't have to filter out other config info. - Don't have to deal with lots of weird edge cases. ## Does this PR fix an existing issue? No. ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/util/lazygit.lua | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lua/lazyvim/util/lazygit.lua b/lua/lazyvim/util/lazygit.lua index 1786eefd..b74e987d 100644 --- a/lua/lazyvim/util/lazygit.lua +++ b/lua/lazyvim/util/lazygit.lua @@ -160,13 +160,17 @@ function M.blame_line(opts) end function M.browse() - local config = require("lazy.manage.git").get_config(LazyVim.root.detectors.pattern(0, { ".git" })[1]) + local lines = require("lazy.manage.process").exec({ "git", "remote", "-v" }) local remotes = {} ---@type {name:string, url:string}[] - for name, url in pairs(config) do - name = name:match("^remote%.(.-)%.url$") - if name then - url = url:gsub("git@github.com:", "https://github.com/"):gsub("%.git$", "") --[[@as string]] + + for _, line in ipairs(lines) do + local name, url = line:match("(%S+)%s+(%S+)%s+%(fetch%)") + if name and url then + if url:find("git@github.com") or url:find("git@bitbucket.org") or url:find("git@gitlab.com") then + url = url:gsub("git@(%S+):", "https://%1/"):gsub(".git$", "") + end table.insert(remotes, { name = name, url = url }) + LazyVim.info(("Found remote %s %s)"):format(name, url)) end end From d9caee610038548a4b79f2b6eb126180ec8ba6b6 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 17 Jun 2024 19:53:30 +0200 Subject: [PATCH 099/323] fix(git): removed debug info --- lua/lazyvim/util/lazygit.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/lua/lazyvim/util/lazygit.lua b/lua/lazyvim/util/lazygit.lua index b74e987d..c9ac1bb8 100644 --- a/lua/lazyvim/util/lazygit.lua +++ b/lua/lazyvim/util/lazygit.lua @@ -170,7 +170,6 @@ function M.browse() url = url:gsub("git@(%S+):", "https://%1/"):gsub(".git$", "") end table.insert(remotes, { name = name, url = url }) - LazyVim.info(("Found remote %s %s)"):format(name, url)) end end From bdca1e95ff97348501a715bd6aa5977422a27969 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 17 Jun 2024 20:06:54 +0200 Subject: [PATCH 100/323] fix(edgy): only enable edgy neo-tree when needed. Fixes #3697. Closes #3703 --- lua/lazyvim/plugins/extras/ui/edgy.lua | 68 +++++++++++++------------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/lua/lazyvim/plugins/extras/ui/edgy.lua b/lua/lazyvim/plugins/extras/ui/edgy.lua index 95b2ccf1..bdafb662 100644 --- a/lua/lazyvim/plugins/extras/ui/edgy.lua +++ b/lua/lazyvim/plugins/extras/ui/edgy.lua @@ -53,26 +53,7 @@ return { { title = "Neotest Output", ft = "neotest-output-panel", size = { height = 15 } }, }, left = { - { - title = "Neo-Tree", - ft = "neo-tree", - filter = function(buf) - return vim.b[buf].neo_tree_source == "filesystem" - end, - pinned = true, - open = function() - require("neo-tree.command").execute({ dir = LazyVim.root() }) - end, - size = { height = 0.5 }, - }, { title = "Neotest Summary", ft = "neotest-summary" }, - { - title = "Neo-Tree Other", - ft = "neo-tree", - filter = function(buf) - return vim.b[buf].neo_tree_source ~= nil - end, - }, -- "neo-tree", }, keys = { @@ -95,22 +76,43 @@ return { }, } - -- 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" } + if LazyVim.has("neo-tree.nvim") then + table.insert(opts.left, 1, { + title = "Neo-Tree", + ft = "neo-tree", + filter = function(buf) + return vim.b[buf].neo_tree_source == "filesystem" + end, + pinned = true, + open = function() + require("neo-tree.command").execute({ dir = 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, source) then - table.insert(opts.left, 3, { - 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, - }) + 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 From 492fa86faa29f2987f662ad0cdb796b5c1c49ef3 Mon Sep 17 00:00:00 2001 From: Songli Yu <1097985743@qq.com> Date: Tue, 18 Jun 2024 13:15:24 +0800 Subject: [PATCH 101/323] fix(snippets): nvim-snippets `` prev key (#3712) Fix nvim-snippets' rollback keymap. --- lua/lazyvim/plugins/coding.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index e73d904e..6ad614a3 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -103,7 +103,7 @@ return { { "", function() - return vim.snippet.active({ direction = -1 }) and "lua vim.snippet.jump(-1)" or "" + return vim.snippet.active({ direction = -1 }) and "lua vim.snippet.jump(-1)" or "" end, expr = true, silent = true, From a6217432250851c69ff9819e7e1013233e6d176b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 18 Jun 2024 05:16:00 +0000 Subject: [PATCH 102/323] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 0b8c788b..503edeea 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 17 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 18 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 8a89c0360e4a076b99b09fe673fbd947f71577fc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 18 Jun 2024 17:28:50 +0200 Subject: [PATCH 103/323] chore(main): release 12.17.0 (#3689) :robot: I have created a release *beep* *boop* --- ## [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)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e4d07691..e5e9e98c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog +## [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) From 1a295c5ef8cab02c6054067c35ca805a3e4ccf72 Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Tue, 18 Jun 2024 19:42:34 +0300 Subject: [PATCH 104/323] fix(statuscolumn): `%r` deprecated in nightly and `%l` handles everything (#3719) ## What is this PR for? Fix correctly showing relative numbers in `statuscolumn` after recent breaking changes on [nightly](https://github.com/neovim/neovim/pull/29357). Please feel free to disregard this PR if a better solution is possible. ## Does this PR fix an existing issue? Fixes #3721 ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/util/ui.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lua/lazyvim/util/ui.lua b/lua/lazyvim/util/ui.lua index 1ad2b6f0..f14096db 100644 --- a/lua/lazyvim/util/ui.lua +++ b/lua/lazyvim/util/ui.lua @@ -140,10 +140,14 @@ 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.v.relnum == 0 then - components[2] = is_num and "%l" or "%r" -- the current line + if vim.fn.has("nvim-0.11") == 1 then + components[2] = "%l" -- 0.11 handles both the current and other lines with %l 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 components[2] = "%=" .. components[2] .. " " -- right align end From 07ab681b1d6f0223e6b265f3eb6aaafbd12e5c0e Mon Sep 17 00:00:00 2001 From: xiaojianzheng <1272209235@qq.com> Date: Wed, 19 Jun 2024 00:47:40 +0800 Subject: [PATCH 105/323] feat(project): add fzf-lua keymap descriptions (#3690) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ![image](https://github.com/LazyVim/LazyVim/assets/29248764/17f36737-8416-4612-a2bf-17a264ca5814) Co-authored-by: 肖健正 --- lua/lazyvim/plugins/extras/util/project.lua | 100 ++++++++++++-------- 1 file changed, 63 insertions(+), 37 deletions(-) diff --git a/lua/lazyvim/plugins/extras/util/project.lua b/lua/lazyvim/plugins/extras/util/project.lua index c84b73bb..42958872 100644 --- a/lua/lazyvim/plugins/extras/util/project.lua +++ b/lua/lazyvim/plugins/extras/util/project.lua @@ -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) - fzf_lua.files({ cwd = selected[1] }) - end, - }, - ["ctrl-t"] = actions.file_tabedit, - ["ctrl-s"] = { - function(selected) - fzf_lua.live_grep({ cwd = selected[1] }) - end, - }, - ["ctrl-r"] = { - function(selected) - fzf_lua.oldfiles({ cwd = selected[1] }) - end, - }, - ["ctrl-w"] = { - function(selected) - local path = selected[1] - local ok = project.set_pwd(path) - if ok then - vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("", true, false, true), "n", true) - LazyVim.info("Change project dir to " .. path) - end - end, - }, - ["ctrl-d"] = function(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, + 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 + + function actions.project_live_grep(selected) + fzf_lua.live_grep({ cwd = selected[1] }) + end + + function actions.project_oldfiles(selected) + fzf_lua.oldfiles({ cwd = selected[1] }) + 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("", true, false, true), "n", true) + LazyVim.info("Change project dir to " .. path) + end + 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 + + -- 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 From 06f13daf7261377ecfa6b4ac845d742f446df719 Mon Sep 17 00:00:00 2001 From: dbger <3982742+dbger@users.noreply.github.com> Date: Wed, 19 Jun 2024 01:02:41 +0800 Subject: [PATCH 106/323] fix(dap): get the correct debugpy pkg path on windows (#3716) ## What is this PR for? fix(dap): get the correct debugpy pkg path on windows. ## Does this PR fix an existing issue? ## Checklist - [ ] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/lang/python.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/python.lua b/lua/lazyvim/plugins/extras/lang/python.lua index e328a51f..9aeca2a4 100644 --- a/lua/lazyvim/plugins/extras/lang/python.lua +++ b/lua/lazyvim/plugins/extras/lang/python.lua @@ -92,7 +92,11 @@ return { { "dPc", function() require('dap-python').test_class() end, desc = "Debug Class", ft = "python" }, }, config = function() - require("dap-python").setup(LazyVim.get_pkg_path("debugpy", "/venv/bin/python")) + if vim.fn.has("win32") == 1 then + require("dap-python").setup(LazyVim.get_pkg_path("debugpy", "/venv/Scripts/python.exe")) + else + require("dap-python").setup(LazyVim.get_pkg_path("debugpy", "/venv/bin/python")) + end end, }, }, From 1101c3ed24709feec85371a951ea0feed6bd50fa Mon Sep 17 00:00:00 2001 From: Ahmed Kamal Date: Wed, 19 Jun 2024 03:03:19 +1000 Subject: [PATCH 107/323] feat(extra): add prisma support and config (#3684) ## What is this PR for? Adding support for prisma ## Does this PR fix an existing issue? No ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --------- Co-authored-by: Ben Puryear <54869170+Ben10164@users.noreply.github.com> --- lua/lazyvim/plugins/extras/lang/prisma.lua | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 lua/lazyvim/plugins/extras/lang/prisma.lua diff --git a/lua/lazyvim/plugins/extras/lang/prisma.lua b/lua/lazyvim/plugins/extras/lang/prisma.lua new file mode 100644 index 00000000..f086d4ca --- /dev/null +++ b/lua/lazyvim/plugins/extras/lang/prisma.lua @@ -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 = {}, + }, + }, + }, +} From 67eece6d74f071035ca7b934a753d71d1677dd9b Mon Sep 17 00:00:00 2001 From: Adam K <105152139+akthe-at@users.noreply.github.com> Date: Tue, 18 Jun 2024 14:31:41 -0500 Subject: [PATCH 108/323] fix(extras.python): avoid launching extra console with dap on Windows (#3723) On Windows, when using dap, python.exe will launch an extra console. If you target pythonw.exe this avoids that. Explanation source: https://stackoverflow.com/questions/9705982/pythonw-exe-or-python-exe ## What is this PR for? Modify which exe is targeted for python + dap on windows. If you use python.exe an extra console launches (eg, nvim is runnining on Wezterm, boot up dap, and as a result an external console (usually through windows terminal or built-in console terminal) will launch (dap still runs in the original window). This is avoided with pythonw.exe ## Does this PR fix an existing issue? No ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/lang/python.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/python.lua b/lua/lazyvim/plugins/extras/lang/python.lua index 9aeca2a4..399f28e3 100644 --- a/lua/lazyvim/plugins/extras/lang/python.lua +++ b/lua/lazyvim/plugins/extras/lang/python.lua @@ -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 From d4991d5aac3c4ab5865e65d73fb8957b3d61bdc3 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 19 Jun 2024 18:25:56 +0200 Subject: [PATCH 109/323] fix(root): also check root_dir. Fixes #3732 --- lua/lazyvim/util/root.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/util/root.lua b/lua/lazyvim/util/root.lua index a401ccf4..fc81e92f 100644 --- a/lua/lazyvim/util/root.lua +++ b/lua/lazyvim/util/root.lua @@ -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) From 7afb7a7220b687b087652397cd6625f8ec783d0b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 19 Jun 2024 16:26:34 +0000 Subject: [PATCH 110/323] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 503edeea..24f3a019 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -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 19 ============================================================================== Table of Contents *LazyVim-table-of-contents* From dde4a9dcdf49719c67642d09847dbaf7f9c7a156 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 19 Jun 2024 22:52:18 +0200 Subject: [PATCH 111/323] chore(main): release 12.18.0 (#3722) :robot: I have created a release *beep* *boop* --- ## [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)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e5e9e98c..2062fc48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## [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) From b22831b7e25a4681df171da30204d4d4f7e9abfa Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Fri, 21 Jun 2024 22:14:48 +0300 Subject: [PATCH 112/323] feat(gitsigns): new keymap for `Gitsigns blame` (#3758) Also add filetype `gitsigns.blame` to autocmd `lazyvim_close_with_q` and workaround for `+hunks` group name to show prefix correctly. If you don't like the workaround for `+hunks` group name feel free to remove it. ## What is this PR for? Make use of the new `gitsigns` feature `Gitsigns blame`, which shows in a vertical buffer split the `blame` history of the whole buffer. ## Does this PR fix an existing issue? No. ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/config/autocmds.lua | 1 + lua/lazyvim/plugins/editor.lua | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/config/autocmds.lua b/lua/lazyvim/config/autocmds.lua index 2fc283ba..81d0209a 100644 --- a/lua/lazyvim/config/autocmds.lua +++ b/lua/lazyvim/config/autocmds.lua @@ -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 diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 05fe5c25..b80c0d8f 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -177,7 +177,7 @@ return { ["c"] = { name = "+code" }, ["f"] = { name = "+file/find" }, ["g"] = { name = "+git" }, - ["gh"] = { name = "+hunks" }, + ["gh"] = { name = "+hunks", ["_"] = "which_key_ignore" }, ["q"] = { name = "+quit/session" }, ["s"] = { name = "+search" }, ["u"] = { name = "+ui" }, @@ -226,6 +226,7 @@ return { map("n", "ghR", gs.reset_buffer, "Reset Buffer") map("n", "ghp", gs.preview_hunk_inline, "Preview Hunk Inline") map("n", "ghb", function() gs.blame_line({ full = true }) end, "Blame Line") + map("n", "ghB", function() gs.blame() end, "Blame Buffer") map("n", "ghd", gs.diffthis, "Diff This") map("n", "ghD", function() gs.diffthis("~") end, "Diff This ~") map({ "o", "x" }, "ih", ":Gitsigns select_hunk", "GitSigns Select Hunk") From b0274a2222752b809188e86101a96791a72e03bf Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 21 Jun 2024 19:15:24 +0000 Subject: [PATCH 113/323] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 24f3a019..dc975714 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 19 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 21 ============================================================================== Table of Contents *LazyVim-table-of-contents* From b47c65f4087c4d82720ab7439f395aba5d6b5f40 Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Fri, 21 Jun 2024 22:15:32 +0300 Subject: [PATCH 114/323] fix(statuscolumn): fix `folds_open = true` (#3756) After some recent changes in https://github.com/neovim/neovim/pull/28709 I was getting an error when the user had `folds_open = true` in his personal configuration whenever he pressed `o/O`. This is an attempt to fix that. ## What is this PR for? I was getting an error with `folds_open = true` in the user configuration whenever pressing `o/O` or pressing `Enter` for a new line. The error was `Error executing lua: ...e/jrn23/projects/plugins/LazyVim/lua/lazyvim/util/ui.lua:127: attempt to index a number value`. ## Does this PR fix an existing issue? No ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/util/ui.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/util/ui.lua b/lua/lazyvim/util/ui.lua index f14096db..6bb8a4f7 100644 --- a/lua/lazyvim/util/ui.lua +++ b/lua/lazyvim/util/ui.lua @@ -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 From 3dfc2c0fd8f3abe5cece9d4479c42b41b46c399f Mon Sep 17 00:00:00 2001 From: Ben Elan Date: Sat, 22 Jun 2024 22:00:07 -0700 Subject: [PATCH 115/323] ci(release): fix version bumping in extra-file (#3772) ## What is this PR for? Fix release-please CI so the version in the `extra-file` is bumped. ## Does this PR fix an existing issue? No ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. ref: folke/lazy.nvim#1534 --------- Co-authored-by: github-actions[bot] --- .github/.release-please-manifest.json | 3 +++ .github/release-please-config.json | 9 +++++++++ .github/workflows/ci.yml | 3 ++- doc/LazyVim.txt | 2 +- release-please-config.json | 5 ----- 5 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 .github/.release-please-manifest.json create mode 100644 .github/release-please-config.json delete mode 100644 release-please-config.json diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json new file mode 100644 index 00000000..2a3d0770 --- /dev/null +++ b/.github/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "12.18.0" +} diff --git a/.github/release-please-config.json b/.github/release-please-config.json new file mode 100644 index 00000000..41fccb15 --- /dev/null +++ b/.github/release-please-config.json @@ -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"] + } + } +} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fddf82ac..9040f5e0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 }} diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index dc975714..7227a1d2 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 21 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 23 ============================================================================== Table of Contents *LazyVim-table-of-contents* diff --git a/release-please-config.json b/release-please-config.json deleted file mode 100644 index 1d1b8b1d..00000000 --- a/release-please-config.json +++ /dev/null @@ -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"] -} From 55464b77c6ae8f14306ce743bcb3c5c465af3d4f Mon Sep 17 00:00:00 2001 From: Fredrik Averpil Date: Sun, 23 Jun 2024 07:01:22 +0200 Subject: [PATCH 116/323] feat(go): switch to neotest-golang (#3749) ## What is this PR for? This PR switches [nvim-neotest/neotest-go](https://github.com/nvim-neotest/neotest-go) for [fredrikaverpil/neotest-golang](https://github.com/fredrikaverpil/neotest-golang). ## Does this PR fix an existing issue? Neotest-go comes with some problems which are mitigated in neotest-golang. A full description/background is available in the project README, but here are some highlights: ### Neotest-go issues mitigated in neotest-golang - Test Output in JSON, making it difficult to read: [neotest-go#52](https://github.com/nvim-neotest/neotest-go/issues/52) - "Run nearest" runs all tests: [neotest-go#83](https://github.com/nvim-neotest/neotest-go/issues/83) - Running test suite doesn't work: [neotest-go#89](https://github.com/nvim-neotest/neotest-go/issues/89) - Diagnostics for table tests on the line of failure: [neotest-go#75](https://github.com/nvim-neotest/neotest-go/issues/75) - Support for Nested Subtests: [neotest-go#74](https://github.com/nvim-neotest/neotest-go/issues/74) - DAP support: [neotest-go#12](https://github.com/nvim-neotest/neotest-go/issues/12) ### Features - Supports all [Neotest usage](https://github.com/nvim-neotest/neotest#usage). - Integrates with [nvim-dap-go](https://github.com/leoluz/nvim-dap-go) for debugging of tests using delve. - Inline diagnostics. - Works great with [andythigpen/nvim-coverage](https://github.com/andythigpen/nvim-coverage) for displaying coverage in the sign column (per-Go package, or per-test basis). - Monorepo support (detect, run and debug tests in sub-projects). - Supports table tests (relies on treesitter AST detection). - Supports nested test functions. ## Notes - I'm the author of [fredrikaverpil/neotest-golang](https://github.com/fredrikaverpil/neotest-golang). ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/lang/go.lua | 14 +++++--------- lua/lazyvim/plugins/extras/test/core.lua | 7 ++++--- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/go.lua b/lua/lazyvim/plugins/extras/lang/go.lua index 58c48643..931f8df4 100644 --- a/lua/lazyvim/plugins/extras/lang/go.lua +++ b/lua/lazyvim/plugins/extras/lang/go.lua @@ -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 - { "td", "lua require('dap-go').debug_test()", 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 }, }, }, diff --git a/lua/lazyvim/plugins/extras/test/core.lua b/lua/lazyvim/plugins/extras/test/core.lua index dd7c7640..cab47ee9 100644 --- a/lua/lazyvim/plugins/extras/test/core.lua +++ b/lua/lazyvim/plugins/extras/test/core.lua @@ -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 }, From b45d4ed62c613a4c47dd9183cf51985f2b153b21 Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Sun, 23 Jun 2024 08:01:58 +0300 Subject: [PATCH 117/323] fix(refactoring): use `pick` for both Telescope and fzf-lua (#3769) ## What is this PR for? Provide a `pick` function to `refactoring.nvim` similar to `project.nvim` ## Does this PR fix an existing issue? Fixes #3762 ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- .../plugins/extras/editor/refactoring.lua | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/lua/lazyvim/plugins/extras/editor/refactoring.lua b/lua/lazyvim/plugins/extras/editor/refactoring.lua index 9d8f8f9c..29920347 100644 --- a/lua/lazyvim/plugins/extras/editor/refactoring.lua +++ b/lua/lazyvim/plugins/extras/editor/refactoring.lua @@ -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 { { "r", "", desc = "+refactor", mode = { "n", "v" } }, { "rs", - function() - require("telescope").extensions.refactoring.refactors() - end, + pick, mode = "v", desc = "Refactor", }, From 19e366277b0f95c74cc90fe6f769691a3c6677c0 Mon Sep 17 00:00:00 2001 From: Gobinda Goshwami Date: Sun, 23 Jun 2024 11:08:41 +0600 Subject: [PATCH 118/323] refactor(extras.ui): simplify neo-tree related logic in edgy extra (#3738) Refactor neo-tree related logic ## What is this PR for? Simplification of `neo-tree` related logic in `edgy.lua` ## Does this PR fix an existing issue? No, but it may prevent future issues with `edgy` if `neo-tree` source configuration changes. ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/ui/edgy.lua | 55 ++++++++++---------------- 1 file changed, 20 insertions(+), 35 deletions(-) diff --git a/lua/lazyvim/plugins/extras/ui/edgy.lua b/lua/lazyvim/plugins/extras/ui/edgy.lua index bdafb662..16b712e2 100644 --- a/lua/lazyvim/plugins/extras/ui/edgy.lua +++ b/lua/lazyvim/plugins/extras/ui/edgy.lua @@ -77,42 +77,27 @@ return { } if LazyVim.has("neo-tree.nvim") then - table.insert(opts.left, 1, { - title = "Neo-Tree", - ft = "neo-tree", - filter = function(buf) - return vim.b[buf].neo_tree_source == "filesystem" - end, - pinned = true, - open = function() - require("neo-tree.command").execute({ dir = 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 + 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 == v + end, + pinned = true, + open = function() + vim.cmd(("Neotree show position=%s %s dir=%s"):format(pos[v] or "bottom", v, LazyVim.root())) + 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 From 52d46166b14a9e99509c509482d9a0979fa00809 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 23 Jun 2024 07:11:55 +0200 Subject: [PATCH 119/323] fix(neo-tree): don't enable document symbols by default --- lua/lazyvim/plugins/editor.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index b80c0d8f..1316ce76 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -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, From 1f423930e03078eb1a2786356a46287c8a466c91 Mon Sep 17 00:00:00 2001 From: Brian Di Palma <1597820+briandipalma@users.noreply.github.com> Date: Sun, 23 Jun 2024 06:13:51 +0100 Subject: [PATCH 120/323] feat(gitsigns): navigate diff changes as well as git hunks with [h/]h (#3736) ## What is this PR for? I'm used to jumping from git hunks with `[h` so I'd like to use the same mapping when navigating diffs. ## Does this PR fix an existing issue? No ## Checklist - [X] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/editor.lua | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 1316ce76..f559c699 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -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" }, "ghs", ":Gitsigns stage_hunk", "Stage Hunk") From 002ce62413e47c278525d7e092c205b2c850ece1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 23 Jun 2024 07:38:34 +0200 Subject: [PATCH 121/323] chore(main): release 12.19.0 (#3760) :robot: I have created a release *beep* *boop* --- ## [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)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/.release-please-manifest.json | 2 +- CHANGELOG.md | 16 ++++++++++++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index 2a3d0770..6b671a44 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "12.18.0" + ".": "12.19.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 2062fc48..864b86ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## [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) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index de41ec8c..e0825676 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -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.0" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From abec8fbb03bdbe881c35401274083f315025a1ed Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 23 Jun 2024 08:56:15 +0200 Subject: [PATCH 122/323] fix(markdown): added support for mdx files --- lua/lazyvim/plugins/extras/lang/markdown.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/markdown.lua b/lua/lazyvim/plugins/extras/lang/markdown.lua index 0b1c08a8..856d3ab6 100644 --- a/lua/lazyvim/plugins/extras/lang/markdown.lua +++ b/lua/lazyvim/plugins/extras/lang/markdown.lua @@ -1,7 +1,10 @@ +vim.filetype.add({ + extension = { mdx = "markdown.mdx" }, +}) return { recommended = function() return LazyVim.extras.wants({ - ft = "markdown", + ft = { "markdown", "markdown.mdx" }, root = "README.md", }) end, From 8ea3f690e6017ba37022060a62f1d69fbf3aeaf7 Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Sun, 23 Jun 2024 16:38:27 +0300 Subject: [PATCH 123/323] fix(lazygit): use `lazy.util.open` on Neovim <= 0.10 (#3778) ## What is this PR for? Use `lazy.util.open` on Neovim <=0.10 ## Does this PR fix an existing issue? Closes #3776 ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/util/lazygit.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/lazyvim/util/lazygit.lua b/lua/lazyvim/util/lazygit.lua index c9ac1bb8..d69941df 100644 --- a/lua/lazyvim/util/lazygit.lua +++ b/lua/lazyvim/util/lazygit.lua @@ -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 From b55c7734df72ff06659c16f5f9ed27b6b7199d44 Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Sun, 23 Jun 2024 21:04:51 +0300 Subject: [PATCH 124/323] fix(dap): only load `mason-nvim-dap` when not disabled (#3784) ## What is this PR for? Only `require("mason-nvim-dap")` when it's not disabled ## Does this PR fix an existing issue? Fixes #3783 ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/dap/core.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/dap/core.lua b/lua/lazyvim/plugins/extras/dap/core.lua index 045fb022..ac6709f1 100644 --- a/lua/lazyvim/plugins/extras/dap/core.lua +++ b/lua/lazyvim/plugins/extras/dap/core.lua @@ -49,7 +49,9 @@ return { config = function() -- 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" }) From 8be66bb1a62aae97552032926fdcc101867b2028 Mon Sep 17 00:00:00 2001 From: Sandeep Dilip <34922961+sanman1k98@users.noreply.github.com> Date: Sun, 23 Jun 2024 16:19:47 -0400 Subject: [PATCH 125/323] fix(extras.astro): support `astro.config.ts` root (#3786) ## What is this PR for? Support [`astro.config.ts`](https://docs.astro.build/en/guides/configuring-astro/#supported-config-file-types) as a root file for the Astro extra. ## Does this PR fix an existing issue? N/A ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/lang/astro.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/lazyvim/plugins/extras/lang/astro.lua b/lua/lazyvim/plugins/extras/lang/astro.lua index a4384148..1364902b 100644 --- a/lua/lazyvim/plugins/extras/lang/astro.lua +++ b/lua/lazyvim/plugins/extras/lang/astro.lua @@ -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, From 2a7ba6d09ce85fa752c25e68ca5287e24b8cee75 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 23 Jun 2024 22:24:44 +0200 Subject: [PATCH 126/323] chore(main): release 12.19.1 (#3775) :robot: I have created a release *beep* *boop* --- ## [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)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/.release-please-manifest.json | 2 +- CHANGELOG.md | 10 ++++++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index 6b671a44..6231a550 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "12.19.0" + ".": "12.19.1" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 864b86ee..a59494db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # 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) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index e0825676..23d4d63c 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "12.19.0" -- x-release-please-version +M.version = "12.19.1" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From b5945c2fc8cbb531983c7ec27d283ad8abf1acec Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Mon, 24 Jun 2024 23:11:32 +0300 Subject: [PATCH 127/323] fix(fzf): disable `preview` for `vtsls` (#3798) ## What is this PR for? Disable `preview` in `fzf-lua` Extra for `vtsls`. I tested it with Python and Typescript Extras and in Typescript pressing `ca` shows without previewer, while in Python the same shows with previewer. Kindly check also that this is correct and I didn't miss out anything else. ## Does this PR fix an existing issue? Fixes #3773 ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/editor/fzf.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/editor/fzf.lua b/lua/lazyvim/plugins/extras/editor/fzf.lua index 8a0a2927..f53ce57b 100644 --- a/lua/lazyvim/plugins/extras/editor/fzf.lua +++ b/lua/lazyvim/plugins/extras/editor/fzf.lua @@ -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", }, From 351336244c0a68d4ebed7f687e27e6eab8e5da09 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 24 Jun 2024 22:11:59 +0200 Subject: [PATCH 128/323] perf(markdown): add filetype in VeryLazy --- lua/lazyvim/plugins/extras/lang/markdown.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/markdown.lua b/lua/lazyvim/plugins/extras/lang/markdown.lua index 856d3ab6..c7f14cbd 100644 --- a/lua/lazyvim/plugins/extras/lang/markdown.lua +++ b/lua/lazyvim/plugins/extras/lang/markdown.lua @@ -1,6 +1,8 @@ -vim.filetype.add({ - extension = { mdx = "markdown.mdx" }, -}) +LazyVim.on_very_lazy(function() + vim.filetype.add({ + extension = { mdx = "markdown.mdx" }, + }) +end) return { recommended = function() return LazyVim.extras.wants({ From faee8ce5819c40852f574aafad55701e2492ffae Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 25 Jun 2024 00:24:38 +0200 Subject: [PATCH 129/323] fix(noice): dont show old messages when installing plugins --- lua/lazyvim/plugins/extras/util/octo.lua | 4 +--- lua/lazyvim/plugins/ui.lua | 9 +++++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lua/lazyvim/plugins/extras/util/octo.lua b/lua/lazyvim/plugins/extras/util/octo.lua index cc5c47bf..a8286265 100644 --- a/lua/lazyvim/plugins/extras/util/octo.lua +++ b/lua/lazyvim/plugins/extras/util/octo.lua @@ -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 diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index 8adb760c..4586bf38 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -291,6 +291,15 @@ return { { "", function() if not require("noice.lsp").scroll(4) then return "" end end, silent = true, expr = true, desc = "Scroll Forward", mode = {"i", "n", "s"} }, { "", function() if not require("noice.lsp").scroll(-4) then return "" 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 From fa2fc6403185faabc47741b3aa2809192870b92e Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 25 Jun 2024 00:24:59 +0200 Subject: [PATCH 130/323] fix(dashboard): load dashboard when closing lazy if needed --- lua/lazyvim/plugins/ui.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index 4586bf38..a060cc65 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -357,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 From f1c5329dca1f0ca370bc9a7887364d1b75187fd4 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 25 Jun 2024 06:36:16 +0200 Subject: [PATCH 131/323] test: disable packages for tests --- tests/init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/init.lua b/tests/init.lua index 85deca35..64cfdaae 100644 --- a/tests/init.lua +++ b/tests/init.lua @@ -28,6 +28,7 @@ local function main() print("Installing plugins") require("lazy").setup(plugins, { root = root .. "/plugins", + pkg = { enabled = false }, performance = { rtp = { reset = false, From d87c7702bf1199c3b3e1fd493d12e6ba91715c11 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 25 Jun 2024 04:36:54 +0000 Subject: [PATCH 132/323] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 7227a1d2..d0bc0c57 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 23 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 25 ============================================================================== Table of Contents *LazyVim-table-of-contents* From a33eabddd9f3786421652d07894516d946c88647 Mon Sep 17 00:00:00 2001 From: dbger <3982742+dbger@users.noreply.github.com> Date: Tue, 25 Jun 2024 12:38:11 +0800 Subject: [PATCH 133/323] fix(util.terminal): fix the shellredir and shellpipe options for powershell (#3803) ## What is this PR for? fix(util.terminal) recorrect the shellredir and shellpip options for powershell. ## Does this PR fix an existing issue? ## Checklist - [ ] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --------- Co-authored-by: Folke Lemaitre --- lua/lazyvim/util/terminal.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/util/terminal.lua b/lua/lazyvim/util/terminal.lua index 6d40dc95..598f8ffc 100644 --- a/lua/lazyvim/util/terminal.lua +++ b/lua/lazyvim/util/terminal.lua @@ -29,10 +29,10 @@ function M.setup(shell) "-NoLogo -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.UTF8Encoding]::new();$PSDefaultParameterValues['Out-File:Encoding']='utf8';" -- Setting shell redirection - vim.o.shellredir = '2>&1 | %{ "$_" } | Out-File %s; exit $LastExitCode' + vim.o.shellredir = '2>&1 | %%{ "$_" } | Out-File %s; exit $LastExitCode' -- Setting shell pipe - vim.o.shellpipe = '2>&1 | %{ "$_" } | Tee-Object %s; exit $LastExitCode' + vim.o.shellpipe = '2>&1 | %%{ "$_" } | Tee-Object %s; exit $LastExitCode' -- Setting shell quote options vim.o.shellquote = "" From 938a6718c6f0d5c6716a34bd3383758907820c52 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 25 Jun 2024 20:30:57 +0200 Subject: [PATCH 134/323] feat(autocmds): added proper bigfile support --- lua/lazyvim/config/autocmds.lua | 22 ++++++++++++++++++++++ lua/lazyvim/config/options.lua | 6 ++++++ 2 files changed, 28 insertions(+) diff --git a/lua/lazyvim/config/autocmds.lua b/lua/lazyvim/config/autocmds.lua index 81d0209a..cf013e1f 100644 --- a/lua/lazyvim/config/autocmds.lua +++ b/lua/lazyvim/config/autocmds.lua @@ -114,3 +114,25 @@ vim.api.nvim_create_autocmd({ "BufWritePre" }, { vim.fn.mkdir(vim.fn.fnamemodify(file, ":p:h"), "p") end, }) + +vim.filetype.add({ + pattern = { + [".*"] = { + function(path, buf) + return vim.bo[buf].filetype ~= "bigfile" and path and vim.fn.getfsize(path) > vim.g.bigfile_size and "bigfile" + or nil + end, + }, + }, +}) + +vim.api.nvim_create_autocmd({ "FileType" }, { + group = augroup("bigfile"), + pattern = "bigfile", + callback = function(ev) + vim.b.minianimate_disable = true + vim.schedule(function() + vim.bo[ev.buf].syntax = vim.filetype.match({ buf = ev.buf }) or "" + end) + end, +}) diff --git a/lua/lazyvim/config/options.lua b/lua/lazyvim/config/options.lua index d2f8e24a..f324be99 100644 --- a/lua/lazyvim/config/options.lua +++ b/lua/lazyvim/config/options.lua @@ -40,6 +40,12 @@ vim.g.lazyvim_statuscolumn = { -- Hide deprecation warnings vim.g.deprecation_warnings = false +-- Set filetype to `bigfile` for files larger than 1.5 MB +-- Only vim syntax will be enabled (with the correct filetype) +-- LSP, treesitter and other ft plugins will be disabled. +-- mini.animate will also be disabled. +vim.g.bigfile_size = 1024 * 1024 * 1.5 -- 1.5 MB + -- Show the current document symbols location from Trouble in lualine vim.g.trouble_lualine = true From c13215814cd5dc3821625e9f3b55860ba880ebdb Mon Sep 17 00:00:00 2001 From: Slava Markevich Date: Tue, 25 Jun 2024 23:04:32 +0400 Subject: [PATCH 135/323] fix(elixir): fix credo detection for elixir linters. (#3809) ## What is this PR for? Fix detection of elixir `credo` linter. `vim.fn.executable("credo") == 0` will never succeed because `credo` is not binary/executable. It is a `mix` package and only available via `mix credo` command. Instead, the plugins(both `none-ls` and `nvim-lint`) will check for the presence of the `.credo.exs` file. ## Does this PR fix an existing issue? Fixes #3808 ## Checklist - [x] Both linters display credo warnings if `credo` is installed and the `.credo.exs` config exists in a project. - [x] There are no errors if the `.credo.exs` file does not exist in the project. - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/lang/elixir.lua | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/elixir.lua b/lua/lazyvim/plugins/extras/lang/elixir.lua index 3255ffff..d82e988e 100644 --- a/lua/lazyvim/plugins/extras/lang/elixir.lua +++ b/lua/lazyvim/plugins/extras/lang/elixir.lua @@ -33,12 +33,13 @@ return { "nvimtools/none-ls.nvim", optional = true, opts = function(_, opts) - if vim.fn.executable("credo") == 0 then - return - end local nls = require("null-ls") opts.sources = vim.list_extend(opts.sources or {}, { - nls.builtins.diagnostics.credo, + nls.builtins.diagnostics.credo.with({ + condition = function(utils) + return utils.root_has_file(".credo.exs") + end, + }), }) end, }, @@ -46,12 +47,17 @@ return { "mfussenegger/nvim-lint", optional = true, opts = function(_, opts) - if vim.fn.executable("credo") == 0 then - return - end opts.linters_by_ft = { elixir = { "credo" }, } + + opts.linters = { + credo = { + condition = function(ctx) + return vim.fs.find({ ".credo.exs" }, { path = ctx.filename, upward = true })[1] + end, + }, + } end, }, } From c6b29713a07dba4c37683ee899f41dabbca3482c Mon Sep 17 00:00:00 2001 From: Arthur <82575487+arthur-mountain@users.noreply.github.com> Date: Wed, 26 Jun 2024 04:01:04 +0800 Subject: [PATCH 136/323] docs(extra.sql): add sql options docs (#3765) ## What is this PR for? A small contribution to enhance the documentation and make it easier to use. While vim-dadbod and vim-dadbod-ui recommend using dotenv.vim for env file injection, we aim to provide a simpler method. Instead of implementing file parsing or relying on an external plugin (dotenv.vim), just try directly using a Lua table. ## Does this PR fix an existing issue? none! ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/lang/sql.lua | 28 +++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/lua/lazyvim/plugins/extras/lang/sql.lua b/lua/lazyvim/plugins/extras/lang/sql.lua index 6eee33a6..a4b426ba 100644 --- a/lua/lazyvim/plugins/extras/lang/sql.lua +++ b/lua/lazyvim/plugins/extras/lang/sql.lua @@ -1,3 +1,31 @@ +if lazyvim_docs then + -- The setup below will automatically configure connections without the need for manual input each time. + + -- Example configuration using dictionary with keys: + -- vim.g.dbs = { + -- dev = "Replace with your database connection URL.", + -- staging = "Replace with your database connection URL.", + -- } + -- or + -- Example configuration using a list of dictionaries: + -- vim.g.dbs = { + -- { name = "dev", url = "Replace with your database connection URL." }, + -- { name = "staging", url = "Replace with your database connection URL." }, + -- } + + -- or + -- Create a `.lazy.lua` file in your project and set your connections like this: + -- ```lua + -- vim.g.dbs = {...} + -- + -- return {} + -- ``` + + -- Alternatively, you can also use other methods to inject your environment variables. + + -- Finally, please make sure to add `.lazy.lua` to your `.gitignore` file to protect your secrets. +end + local sql_ft = { "sql", "mysql", "plsql" } return { From 53f4595b4e7ee980e9446a9248862a40701959c1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 25 Jun 2024 22:09:47 +0200 Subject: [PATCH 137/323] chore(main): release 12.20.0 (#3804) :robot: I have created a release *beep* *boop* --- ## [12.20.0](https://github.com/LazyVim/LazyVim/compare/v12.19.1...v12.20.0) (2024-06-25) ### Features * **autocmds:** added proper bigfile support ([938a671](https://github.com/LazyVim/LazyVim/commit/938a6718c6f0d5c6716a34bd3383758907820c52)) ### Bug Fixes * **dashboard:** load dashboard when closing lazy if needed ([fa2fc64](https://github.com/LazyVim/LazyVim/commit/fa2fc6403185faabc47741b3aa2809192870b92e)) * **elixir:** fix credo detection for elixir linters. ([#3809](https://github.com/LazyVim/LazyVim/issues/3809)) ([c132158](https://github.com/LazyVim/LazyVim/commit/c13215814cd5dc3821625e9f3b55860ba880ebdb)) * **fzf:** disable `preview` for `vtsls` ([#3798](https://github.com/LazyVim/LazyVim/issues/3798)) ([b5945c2](https://github.com/LazyVim/LazyVim/commit/b5945c2fc8cbb531983c7ec27d283ad8abf1acec)) * **noice:** dont show old messages when installing plugins ([faee8ce](https://github.com/LazyVim/LazyVim/commit/faee8ce5819c40852f574aafad55701e2492ffae)) * **util.terminal:** fix the shellredir and shellpipe options for powershell ([#3803](https://github.com/LazyVim/LazyVim/issues/3803)) ([a33eabd](https://github.com/LazyVim/LazyVim/commit/a33eabddd9f3786421652d07894516d946c88647)) ### Performance Improvements * **markdown:** add filetype in VeryLazy ([3513362](https://github.com/LazyVim/LazyVim/commit/351336244c0a68d4ebed7f687e27e6eab8e5da09)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/.release-please-manifest.json | 2 +- CHANGELOG.md | 21 +++++++++++++++++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index 6231a550..2de5a13d 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "12.19.1" + ".": "12.20.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index a59494db..18ad16d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,26 @@ # Changelog +## [12.20.0](https://github.com/LazyVim/LazyVim/compare/v12.19.1...v12.20.0) (2024-06-25) + + +### Features + +* **autocmds:** added proper bigfile support ([938a671](https://github.com/LazyVim/LazyVim/commit/938a6718c6f0d5c6716a34bd3383758907820c52)) + + +### Bug Fixes + +* **dashboard:** load dashboard when closing lazy if needed ([fa2fc64](https://github.com/LazyVim/LazyVim/commit/fa2fc6403185faabc47741b3aa2809192870b92e)) +* **elixir:** fix credo detection for elixir linters. ([#3809](https://github.com/LazyVim/LazyVim/issues/3809)) ([c132158](https://github.com/LazyVim/LazyVim/commit/c13215814cd5dc3821625e9f3b55860ba880ebdb)) +* **fzf:** disable `preview` for `vtsls` ([#3798](https://github.com/LazyVim/LazyVim/issues/3798)) ([b5945c2](https://github.com/LazyVim/LazyVim/commit/b5945c2fc8cbb531983c7ec27d283ad8abf1acec)) +* **noice:** dont show old messages when installing plugins ([faee8ce](https://github.com/LazyVim/LazyVim/commit/faee8ce5819c40852f574aafad55701e2492ffae)) +* **util.terminal:** fix the shellredir and shellpipe options for powershell ([#3803](https://github.com/LazyVim/LazyVim/issues/3803)) ([a33eabd](https://github.com/LazyVim/LazyVim/commit/a33eabddd9f3786421652d07894516d946c88647)) + + +### Performance Improvements + +* **markdown:** add filetype in VeryLazy ([3513362](https://github.com/LazyVim/LazyVim/commit/351336244c0a68d4ebed7f687e27e6eab8e5da09)) + ## [12.19.1](https://github.com/LazyVim/LazyVim/compare/v12.19.0...v12.19.1) (2024-06-23) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 23d4d63c..bd1ebffa 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "12.19.1" -- x-release-please-version +M.version = "12.20.0" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From 135ce0d7edb64958b2c8f636a9ba624ec0721eb3 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 26 Jun 2024 17:09:37 +0200 Subject: [PATCH 138/323] fix(autocmds): check that buf exists --- lua/lazyvim/config/autocmds.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/config/autocmds.lua b/lua/lazyvim/config/autocmds.lua index cf013e1f..58f43f0b 100644 --- a/lua/lazyvim/config/autocmds.lua +++ b/lua/lazyvim/config/autocmds.lua @@ -119,7 +119,11 @@ vim.filetype.add({ pattern = { [".*"] = { function(path, buf) - return vim.bo[buf].filetype ~= "bigfile" and path and vim.fn.getfsize(path) > vim.g.bigfile_size and "bigfile" + return vim.bo[buf] + and vim.bo[buf].filetype ~= "bigfile" + and path + and vim.fn.getfsize(path) > vim.g.bigfile_size + and "bigfile" or nil end, }, From 46e5bdd6f182c309dd81256823b6512d74cf48c9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 26 Jun 2024 15:10:18 +0000 Subject: [PATCH 139/323] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index d0bc0c57..0c6b3b93 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 25 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 26 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 5e1c474192372caca7d95d4a85dd5939fe95cca3 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 26 Jun 2024 18:57:04 +0200 Subject: [PATCH 140/323] test: use busted for tests --- tests/busted.lua | 37 +++++++++++++++++++++++++ tests/extras/lang_spec.lua | 14 ++++++---- tests/init.lua | 57 -------------------------------------- tests/run | 2 +- 4 files changed, 47 insertions(+), 63 deletions(-) create mode 100644 tests/busted.lua delete mode 100644 tests/init.lua diff --git a/tests/busted.lua b/tests/busted.lua new file mode 100644 index 00000000..20b8f9a4 --- /dev/null +++ b/tests/busted.lua @@ -0,0 +1,37 @@ +#!/usr/bin/env -S nvim -l + +-- set stdpaths to use .tests +local root = vim.fn.fnamemodify("./.tests", ":p") +for _, name in ipairs({ "config", "data", "state", "cache" }) do + vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name +end + +-- Bootstrap lazy.nvim +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not (vim.uv or vim.loop).fs_stat(lazypath) then + local lazyrepo = "https://github.com/folke/lazy.nvim.git" + vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) +end +vim.opt.rtp:prepend(lazypath) + +vim.o.loadplugins = true -- enable since nvim -l disables plugins + +-- Setup lazy.nvim +require("lazy").setup({ + spec = { + { "LazyVim/LazyVim", dir = vim.fn.expand(".") }, + "lunarmodules/busted", -- add busted + "LazyVim/starter", + { "nvim-lua/plenary.nvim" }, + { "folke/lazy.nvim" }, + "williamboman/mason-lspconfig.nvim", + "williamboman/mason.nvim", + "nvim-treesitter/nvim-treesitter", + }, + rocks = { hererocks = true }, +}) + +-- run busted +return pcall(require("busted.runner"), { + standalone = false, +}) or os.exit(1) diff --git a/tests/extras/lang_spec.lua b/tests/extras/lang_spec.lua index 7c81c667..19eb337d 100644 --- a/tests/extras/lang_spec.lua +++ b/tests/extras/lang_spec.lua @@ -38,13 +38,10 @@ describe("Extra", function() for _, extra in ipairs(extras) do local name = extra.modname:sub(#"lazyvim.plugins.extras" + 2) describe(name, function() - ---@type any, LazySpecLoader - local mod, spec - it("spec is valid", function() - mod = require(extra.modname) + local mod = require(extra.modname) assert.is_not_nil(mod) - spec = Plugin.Spec.new({ + local spec = Plugin.Spec.new({ { "williamboman/mason.nvim", opts = { ensure_installed = {} } }, { "nvim-treesitter/nvim-treesitter", opts = { ensure_installed = {} } }, mod, @@ -54,10 +51,17 @@ describe("Extra", function() if extra.modname:find("%.lang%.") then it("has recommended set", function() + local mod = require(extra.modname) assert(mod.recommended, "`recommended` not set for " .. extra.modname) end) end + local mod = require(extra.modname) + local spec = Plugin.Spec.new({ + { "williamboman/mason.nvim", opts = { ensure_installed = {} } }, + { "nvim-treesitter/nvim-treesitter", opts = { ensure_installed = {} } }, + mod, + }, { optional = true }) local lspconfig = spec.plugins["nvim-lspconfig"] if lspconfig then it("does not install LSP servers with mason.nvim", function() diff --git a/tests/init.lua b/tests/init.lua deleted file mode 100644 index 64cfdaae..00000000 --- a/tests/init.lua +++ /dev/null @@ -1,57 +0,0 @@ --- DO NOT change the paths and don't remove the colorscheme -local root = vim.fn.fnamemodify("./.tests", ":p") - --- set stdpaths to use .repro -for _, name in ipairs({ "config", "data", "state", "cache" }) do - vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name -end - --- bootstrap lazy -local lazypath = root .. "/plugins/lazy.nvim" -if not vim.loop.fs_stat(lazypath) then - print("Bootstrapping lazy.nvim") - vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath }) -end -vim.opt.runtimepath:prepend(lazypath) - --- install plugins -local plugins = { - "LazyVim/starter", - { "nvim-lua/plenary.nvim" }, - { "folke/lazy.nvim" }, - "williamboman/mason-lspconfig.nvim", - "williamboman/mason.nvim", - "nvim-treesitter/nvim-treesitter", -} - -local function main() - print("Installing plugins") - require("lazy").setup(plugins, { - root = root .. "/plugins", - pkg = { enabled = false }, - performance = { - rtp = { - reset = false, - }, - }, - }) - - if vim.o.filetype == "lazy" then - vim.cmd.close() - end - - print("Updating plugins") - -- update plugins, wait for it to finish and don't show the output - require("lazy").update({ wait = true, show = false }) - -- require("lazy.core.cache").reset() - - vim.opt.rtp:append(".") -end - -local Util = require("lazy.core.util") -Util.try(main, { - on_error = function(err) - print(err) - os.exit(1) - end, -}) diff --git a/tests/run b/tests/run index 631fb09a..7c8bb349 100755 --- a/tests/run +++ b/tests/run @@ -1,3 +1,3 @@ #!/bin/sh -nvim --headless -u tests/init.lua -c "PlenaryBustedDirectory tests {init = 'tests//init.lua', sequential = true}" +nvim -l tests/busted.lua tests -o utfTerminal From e864713163bc01d8c7b3a82acb0cd12025f556f8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 27 Jun 2024 13:28:27 +0200 Subject: [PATCH 141/323] chore(main): release 12.20.1 (#3819) :robot: I have created a release *beep* *boop* --- ## [12.20.1](https://github.com/LazyVim/LazyVim/compare/v12.20.0...v12.20.1) (2024-06-26) ### Bug Fixes * **autocmds:** check that buf exists ([135ce0d](https://github.com/LazyVim/LazyVim/commit/135ce0d7edb64958b2c8f636a9ba624ec0721eb3)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/.release-please-manifest.json | 2 +- CHANGELOG.md | 7 +++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index 2de5a13d..09905898 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "12.20.0" + ".": "12.20.1" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 18ad16d6..395e7d3d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [12.20.1](https://github.com/LazyVim/LazyVim/compare/v12.20.0...v12.20.1) (2024-06-26) + + +### Bug Fixes + +* **autocmds:** check that buf exists ([135ce0d](https://github.com/LazyVim/LazyVim/commit/135ce0d7edb64958b2c8f636a9ba624ec0721eb3)) + ## [12.20.0](https://github.com/LazyVim/LazyVim/compare/v12.19.1...v12.20.0) (2024-06-25) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index bd1ebffa..059fed1e 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "12.20.0" -- x-release-please-version +M.version = "12.20.1" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From 5b44e1040e69c94cf196f444c567e28410f68246 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 27 Jun 2024 11:29:14 +0000 Subject: [PATCH 142/323] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 0c6b3b93..dcb833e8 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 26 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 27 ============================================================================== Table of Contents *LazyVim-table-of-contents* From e5e8d7a8056a8c80456751385e73a4b184bcd436 Mon Sep 17 00:00:00 2001 From: Pavel Savchenko Date: Thu, 27 Jun 2024 15:04:26 +0100 Subject: [PATCH 143/323] fix(neotest): support adapter key on adapter for playwright (#3824) ## What is this PR for? Similar to https://github.com/LazyVim/LazyVim/issues/847 , only this adapter adds a setup function into the 'adapter' key in the plugin table ([source](https://github.com/thenbe/neotest-playwright/blob/f61463f5c74d53fc5975b7e086b7c6e9356d9215/lua/neotest-playwright/init.lua#L31-L33)). It is somewhat annoying that neotest does not provide a recommended way for adapters to define their configuration function (at least not explicitly)... Perhaps we should work around it temporarily, but reach out to either neotest or neotest-playwright authors? ## Does this PR fix an existing issue? I didn't see anyone complaining about playwright adapter in issues or discussions :/ ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/test/core.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/lazyvim/plugins/extras/test/core.lua b/lua/lazyvim/plugins/extras/test/core.lua index cab47ee9..5579ee89 100644 --- a/lua/lazyvim/plugins/extras/test/core.lua +++ b/lua/lazyvim/plugins/extras/test/core.lua @@ -86,6 +86,9 @@ return { local meta = getmetatable(adapter) if adapter.setup then adapter.setup(config) + elseif adapter.adapter then + adapter.adapter(config) + adapter = adapter.adapter elseif meta and meta.__call then adapter(config) else From 329f9dda805ab5ebb11c952df396d8a90dd41c11 Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Thu, 27 Jun 2024 17:05:47 +0300 Subject: [PATCH 144/323] refactor(project): use header descriptions without using `fzf-lua.actions` (#3821) ## What is this PR for? In #3690 there was a [concern expressed](https://github.com/LazyVim/LazyVim/pull/3690#issuecomment-2174024517) about changing `fzf-lua`'s core actions. This PR tries to achieve the same result by manually setting the headers in `fzf_opts["--header"]` and constructing it without use of `fzf-lua.actions`. Feel free to disregard if you think there's no change necessary in the current code, as this is simply a refactor attempt and does not provide any new functionality. ## Does this PR fix an existing issue? No ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/util/project.lua | 105 ++++++++++---------- 1 file changed, 55 insertions(+), 50 deletions(-) diff --git a/lua/lazyvim/plugins/extras/util/project.lua b/lua/lazyvim/plugins/extras/util/project.lua index 42958872..ec5ae386 100644 --- a/lua/lazyvim/plugins/extras/util/project.lua +++ b/lua/lazyvim/plugins/extras/util/project.lua @@ -8,71 +8,76 @@ pick = function() local project = require("project_nvim.project") 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") 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] }) + local function ansi_from_hl(hl, s) + return utils.ansi_from_hl(hl_validate(hl), s) end - function actions.project_live_grep(selected) - fzf_lua.live_grep({ cwd = selected[1] }) - end - - function actions.project_oldfiles(selected) - fzf_lua.oldfiles({ cwd = selected[1] }) - 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("", true, false, true), "n", true) - LazyVim.info("Change project dir to " .. path) - end - 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 - - -- 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_opts = { + ["--header"] = string.format( + ":: <%s> to %s | <%s> to %s | <%s> to %s | <%s> to %s | <%s> to %s", + ansi_from_hl("FzfLuaHeaderBind", "ctrl-t"), + ansi_from_hl("FzfLuaHeaderText", "tabedit"), + ansi_from_hl("FzfLuaHeaderBind", "ctrl-s"), + ansi_from_hl("FzfLuaHeaderText", "live_grep"), + ansi_from_hl("FzfLuaHeaderBind", "ctrl-r"), + ansi_from_hl("FzfLuaHeaderText", "oldfiles"), + ansi_from_hl("FzfLuaHeaderBind", "ctrl-w"), + ansi_from_hl("FzfLuaHeaderText", "change_dir"), + ansi_from_hl("FzfLuaHeaderBind", "ctrl-d"), + ansi_from_hl("FzfLuaHeaderText", "delete") + ), }, 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, + ["default"] = { + function(selected) + fzf_lua.files({ cwd = selected[1] }) + end, + }, + ["ctrl-t"] = { + function(selected) + vim.cmd("tabedit") + fzf_lua.files({ cwd = selected[1] }) + end, + }, + ["ctrl-s"] = { + function(selected) + fzf_lua.live_grep({ cwd = selected[1] }) + end, + }, + ["ctrl-r"] = { + function(selected) + fzf_lua.oldfiles({ cwd = selected[1] }) + end, + }, + ["ctrl-w"] = { + function(selected) + local path = selected[1] + local ok = project.set_pwd(path) + if ok then + vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("", true, false, true), "n", true) + LazyVim.info("Change project dir to " .. path) + end + end, + }, + ["ctrl-d"] = function(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, }, } - opts = core.set_header(opts, { "actions" }) fzf_lua.fzf_exec(results, opts) end end From ff1b44e67606080b8b40d066943c55c92856e3c6 Mon Sep 17 00:00:00 2001 From: dotfrag <17456867+dotfrag@users.noreply.github.com> Date: Thu, 27 Jun 2024 18:31:11 +0300 Subject: [PATCH 145/323] fix(lint): make prepend_args opt work when default args is empty (#3828) ## What is this PR for? There's some logic in `linting.lua` to allow for easy setting of linter args, but it doesn't work when default args is empty. This hopefully fixes it. ## Does this PR fix an existing issue? N/A. ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/linting.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/linting.lua b/lua/lazyvim/plugins/linting.lua index 7b5b3be3..46cf2898 100644 --- a/lua/lazyvim/plugins/linting.lua +++ b/lua/lazyvim/plugins/linting.lua @@ -35,6 +35,7 @@ return { if type(linter) == "table" and type(lint.linters[name]) == "table" then lint.linters[name] = vim.tbl_deep_extend("force", lint.linters[name], linter) if type(linter.prepend_args) == "table" then + lint.linters[name].args = lint.linters[name].args or {} vim.list_extend(lint.linters[name].args, linter.prepend_args) end else From 44ed11c4f8867cdc887fdcba6a22938125a403ee Mon Sep 17 00:00:00 2001 From: k14lb3 <76220140+k14lb3@users.noreply.github.com> Date: Fri, 28 Jun 2024 02:03:08 +0800 Subject: [PATCH 146/323] fix(gitsigns): fix inconsistent signs (#3830) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What is this PR for? Fixing inconsistency with the `gitsigns` signs. Since the signs are overridden ... https://github.com/LazyVim/LazyVim/blob/5e1c474192372caca7d95d4a85dd5939fe95cca3/lua/lazyvim/plugins/editor.lua#L201-L209 The staged signs should be overridden too. > ``` > signs_staged *gitsigns-config-signs_staged* > Type: `table[extended]` > Default: > > { > add = { text = '┃' }, > change = { text = '┃' }, > delete = { text = '▁' }, > topdelete = { text = '▔' }, > changedelete = { text = '~' }, > } > < > Configuration for signs of staged hunks. > > See |gitsigns-config-signs|. > ``` https://github.com/lewis6991/gitsigns.nvim/blob/0595724fa9516a35696ff6b1e3cb95b6462b38b1/doc/gitsigns.txt#L569-L579 > ``` > signs_staged_enable *gitsigns-config-signs_staged_enable* > Type: `boolean`, Default: `true` > > > Show signs for staged hunks. > > > When enabled the signs defined in |git-config-signs_staged|` are used. > ``` https://github.com/lewis6991/gitsigns.nvim/blob/0595724fa9516a35696ff6b1e3cb95b6462b38b1/doc/gitsigns.txt#L584-L589 ## Does this PR fix an existing issue? Nopeskii ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/editor.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index f559c699..c7ceb4f7 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -207,6 +207,13 @@ return { changedelete = { text = "▎" }, untracked = { text = "▎" }, }, + signs_staged = { + add = { text = "▎" }, + change = { text = "▎" }, + delete = { text = "" }, + topdelete = { text = "" }, + changedelete = { text = "▎" }, + }, on_attach = function(buffer) local gs = package.loaded.gitsigns From 87fe403df62fd8b89b886920c4f562da8e162cbe Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Fri, 28 Jun 2024 00:51:57 +0300 Subject: [PATCH 147/323] fix(bufremove): fix `Cancel` (#3834) ## What is this PR for? When you hit `Cancel` and a buffer is modified, it should not delete the buffer. ## Does this PR fix an existing issue? Fixes #3832 ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/util/ui.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/util/ui.lua b/lua/lazyvim/util/ui.lua index 6bb8a4f7..28537bce 100644 --- a/lua/lazyvim/util/ui.lua +++ b/lua/lazyvim/util/ui.lua @@ -231,7 +231,7 @@ function M.bufremove(buf) if vim.bo.modified then local choice = vim.fn.confirm(("Save changes to %q?"):format(vim.fn.bufname()), "&Yes\n&No\n&Cancel") - if choice == 0 then -- Cancel + if choice == 0 or choice == 3 then -- 0 for / and 3 for Cancel return end if choice == 1 then -- Yes From 35f89fb3a189dfaaec0dbdb1882028105c129fa2 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 29 Jun 2024 07:27:41 +0200 Subject: [PATCH 148/323] ci: use lazy minit for tests --- tests/busted.lua | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/tests/busted.lua b/tests/busted.lua index 20b8f9a4..af22bc70 100644 --- a/tests/busted.lua +++ b/tests/busted.lua @@ -1,26 +1,11 @@ #!/usr/bin/env -S nvim -l --- set stdpaths to use .tests -local root = vim.fn.fnamemodify("./.tests", ":p") -for _, name in ipairs({ "config", "data", "state", "cache" }) do - vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name -end - --- Bootstrap lazy.nvim -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not (vim.uv or vim.loop).fs_stat(lazypath) then - local lazyrepo = "https://github.com/folke/lazy.nvim.git" - vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) -end -vim.opt.rtp:prepend(lazypath) - -vim.o.loadplugins = true -- enable since nvim -l disables plugins +vim.env.LAZY_STDPATH = ".tests" +load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))() -- Setup lazy.nvim -require("lazy").setup({ +require("lazy.minit").busted({ spec = { - { "LazyVim/LazyVim", dir = vim.fn.expand(".") }, - "lunarmodules/busted", -- add busted "LazyVim/starter", { "nvim-lua/plenary.nvim" }, { "folke/lazy.nvim" }, @@ -28,10 +13,4 @@ require("lazy").setup({ "williamboman/mason.nvim", "nvim-treesitter/nvim-treesitter", }, - rocks = { hererocks = true }, }) - --- run busted -return pcall(require("busted.runner"), { - standalone = false, -}) or os.exit(1) From 2865253e6e8f75f58c8c3e19488572d031421579 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 29 Jun 2024 08:33:05 +0200 Subject: [PATCH 149/323] test: simplify tests --- tests/busted.lua | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/busted.lua b/tests/busted.lua index af22bc70..4e101682 100644 --- a/tests/busted.lua +++ b/tests/busted.lua @@ -7,8 +7,6 @@ load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/ma require("lazy.minit").busted({ spec = { "LazyVim/starter", - { "nvim-lua/plenary.nvim" }, - { "folke/lazy.nvim" }, "williamboman/mason-lspconfig.nvim", "williamboman/mason.nvim", "nvim-treesitter/nvim-treesitter", From 9dd2e0d39a113557b36d35ece6f279582625e608 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 29 Jun 2024 06:33:57 +0000 Subject: [PATCH 150/323] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index dcb833e8..9bd0fda5 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 27 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 29 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 349508cdf49486c217a578f4dd728211476e036d Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 29 Jun 2024 09:44:33 +0200 Subject: [PATCH 151/323] ci: don't run release/docs on forks with a main branch --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9040f5e0..795d3bd8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,7 +39,7 @@ jobs: docs: runs-on: ubuntu-latest needs: tests - if: ${{ github.ref == 'refs/heads/main' }} + if: ${{ github.ref == 'refs/heads/main' && github.repository_owner == 'LazyVim' }} steps: - uses: actions/checkout@v4 - name: panvimdoc @@ -58,7 +58,7 @@ jobs: commit_author: "github-actions[bot] " release: name: release - if: ${{ github.ref == 'refs/heads/main' }} + if: ${{ github.ref == 'refs/heads/main' && github.repository_owner == 'LazyVim' }} needs: - docs - tests From 683bf52c024306f9c0fccc2b02348692c3f09bfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BA=B3=E8=A5=BF=E5=A6=B2=20=C2=B7=20Nahida?= <139795416+0b10000000011@users.noreply.github.com> Date: Sat, 29 Jun 2024 15:47:03 +0800 Subject: [PATCH 152/323] feat(extras): add `overseer.nvim` plugin extra (#2421) Co-authored-by: Folke Lemaitre --- .../plugins/extras/editor/overseer.lua | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 lua/lazyvim/plugins/extras/editor/overseer.lua diff --git a/lua/lazyvim/plugins/extras/editor/overseer.lua b/lua/lazyvim/plugins/extras/editor/overseer.lua new file mode 100644 index 00000000..0ef281ae --- /dev/null +++ b/lua/lazyvim/plugins/extras/editor/overseer.lua @@ -0,0 +1,100 @@ +return { + { + "catppuccin", + optional = true, + opts = { + integrations = { overseer = true }, + }, + }, + { + "stevearc/overseer.nvim", + cmd = { + "OverseerOpen", + "OverseerClose", + "OverseerToggle", + "OverseerSaveBundle", + "OverseerLoadBundle", + "OverseerDeleteBundle", + "OverseerRunCmd", + "OverseerRun", + "OverseerInfo", + "OverseerBuild", + "OverseerQuickAction", + "OverseerTaskAction", + "OverseerClearCache", + }, + opts = { + dap = false, + task_list = { + bindings = { + [""] = false, + [""] = false, + [""] = false, + [""] = false, + }, + }, + form = { + win_opts = { + winblend = 0, + }, + }, + confirm = { + win_opts = { + winblend = 0, + }, + }, + task_win = { + win_opts = { + winblend = 0, + }, + }, + }, + -- stylua: ignore + keys = { + { "ow", "OverseerToggle", desc = "Task list" }, + { "oo", "OverseerRun", desc = "Run task" }, + { "oq", "OverseerQuickAction", desc = "Action recent task" }, + { "oi", "OverseerInfo", desc = "Overseer Info" }, + { "ob", "OverseerBuild", desc = "Task builder" }, + { "ot", "OverseerTaskAction", desc = "Task action" }, + { "oc", "OverseerClearCache", desc = "Clear cache" }, + }, + }, + { + "folke/which-key.nvim", + optional = true, + opts = { + defaults = { ["o"] = { name = "+overseer" } }, + }, + }, + { + "folke/edgy.nvim", + optional = true, + opts = function(_, opts) + opts.right = opts.right or {} + table.insert(opts.right, { + title = "Overseer", + ft = "OverseerList", + open = function() + require("overseer").open() + end, + }) + end, + }, + { + "nvim-neotest/neotest", + optional = true, + opts = function(_, opts) + opts = opts or {} + opts.consumers = opts.consumers or {} + opts.consumers.overseer = require("neotest.consumers.overseer") + end, + }, + { + "mfussenegger/nvim-dap", + optional = true, + opts = function() + require("overseer").enable_dap() + end, + }, +} From 3764735fb20596dfc9cd0707d2830a40004c7f0e Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 29 Jun 2024 10:19:01 +0200 Subject: [PATCH 153/323] fix(extras): don't load pkgs when parsing specs for LazyExtras --- lua/lazyvim/util/extras.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/util/extras.lua b/lua/lazyvim/util/extras.lua index 07cb27e0..bd5ca4f3 100644 --- a/lua/lazyvim/util/extras.lua +++ b/lua/lazyvim/util/extras.lua @@ -84,13 +84,13 @@ end ---@param source LazyExtraSource function M.get_extra(source, modname) local enabled = vim.tbl_contains(M.state, modname) - local spec = Plugin.Spec.new(nil, { optional = true }) + local spec = Plugin.Spec.new(nil, { optional = true, pkg = false }) spec:parse({ import = modname }) local imports = vim.tbl_filter(function(x) return x ~= modname end, spec.modules) if #imports > 0 then - spec = Plugin.Spec.new(nil, { optional = true }) + spec = Plugin.Spec.new(nil, { optional = true, pkg = false }) spec.modules = vim.deepcopy(imports) spec:parse({ import = modname }) end From 88f25410e020fe64fe42a94d71f0be3db1b918b4 Mon Sep 17 00:00:00 2001 From: Feliche-Demian Netliukh Date: Sat, 29 Jun 2024 09:21:35 +0100 Subject: [PATCH 154/323] feat(extras): add chezmoi extra (#2859) It is just a small extra for those that use Chezmoi) --------- Co-authored-by: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> --- lua/lazyvim/plugins/extras/util/chezmoi.lua | 69 +++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 lua/lazyvim/plugins/extras/util/chezmoi.lua diff --git a/lua/lazyvim/plugins/extras/util/chezmoi.lua b/lua/lazyvim/plugins/extras/util/chezmoi.lua new file mode 100644 index 00000000..f16b5889 --- /dev/null +++ b/lua/lazyvim/plugins/extras/util/chezmoi.lua @@ -0,0 +1,69 @@ +return { + { + -- highlighting for chezmoi files template files + "alker0/chezmoi.vim", + init = function() + vim.g["chezmoi#use_tmp_buffer"] = 1 + vim.g["chezmoi#source_dir_path"] = os.getenv("HOME") .. "/.local/share/chezmoi" + end, + }, + { + "xvzc/chezmoi.nvim", + keys = { + { + "sz", + function() + require("telescope").extensions.chezmoi.find_files() + end, + desc = "Chezmoi", + }, + }, + opts = { + edit = { + watch = false, + force = false, + }, + notification = { + on_open = true, + on_apply = true, + on_watch = false, + }, + telescope = { + select = { "" }, + }, + }, + init = function() + -- run chezmoi edit on file enter + vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, { + pattern = { os.getenv("HOME") .. "/.local/share/chezmoi/*" }, + callback = function() + vim.schedule(require("chezmoi.commands.__edit").watch) + end, + }) + end, + }, + { + "nvimdev/dashboard-nvim", + optional = true, + opts = function(_, opts) + local projects = { + action = "Telescope chezmoi find_files", + desc = " Config", + icon = "", + key = "c", + } + + projects.desc = projects.desc .. string.rep(" ", 43 - #projects.desc) + projects.key_format = " %s" + + -- remove lazyvim config property + for i = #opts.config.center, 1, -1 do + if opts.config.center[i].key == "c" then + table.remove(opts.config.center, i) + end + end + + table.insert(opts.config.center, 5, projects) + end, + }, +} From d6429a5c8ad317057cb852d3cd67ce52e9c30727 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 29 Jun 2024 10:33:26 +0200 Subject: [PATCH 155/323] fix(pick): set recurse_submodules to false when using `auto` picker. Fixes #3831, Closes #3835 --- lua/lazyvim/util/pick.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/util/pick.lua b/lua/lazyvim/util/pick.lua index e4da432f..63037189 100644 --- a/lua/lazyvim/util/pick.lua +++ b/lua/lazyvim/util/pick.lua @@ -80,7 +80,10 @@ function M.open(command, opts) and not vim.uv.fs_stat(cwd .. "/.rgignore") then command = "git_files" - opts.show_untracked = opts.show_untracked ~= false + if opts.show_untracked == nil then + opts.show_untracked = true + opts.recurse_submodules = false + end end end command = M.picker.commands[command] or command From f47d105b80dce615a572a13351a137653444d548 Mon Sep 17 00:00:00 2001 From: Maximilian Stinsky <26960620+mstinsky@users.noreply.github.com> Date: Sat, 29 Jun 2024 10:41:20 +0200 Subject: [PATCH 156/323] feat(extras): switch to markdownlint-cli2 (#3843) ## What is this PR for? This PR switches makrdownlint-cli to markdownlint-cli2. markdownlint-cli2 should be a bit faster than markdownlint-cli and has a more flexible configuration through files in the whole directory tree. The cli is maintained by David Anson who also wrote the markdown style checker itself which is used by the "old" cli and cli2. Blog post from David Anson regarding the new cli itself: https://dlaa.me/blog/post/markdownlintcli2 ## Does this PR fix an existing issue? No ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/lang/markdown.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/markdown.lua b/lua/lazyvim/plugins/extras/lang/markdown.lua index c7f14cbd..fd7c6723 100644 --- a/lua/lazyvim/plugins/extras/lang/markdown.lua +++ b/lua/lazyvim/plugins/extras/lang/markdown.lua @@ -15,14 +15,14 @@ return { optional = true, opts = { formatters_by_ft = { - ["markdown"] = { { "prettierd", "prettier" }, "markdownlint", "markdown-toc" }, - ["markdown.mdx"] = { { "prettierd", "prettier" }, "markdownlint", "markdown-toc" }, + ["markdown"] = { { "prettierd", "prettier" }, "markdownlint-cli2", "markdown-toc" }, + ["markdown.mdx"] = { { "prettierd", "prettier" }, "markdownlint-cli2", "markdown-toc" }, }, }, }, { "williamboman/mason.nvim", - opts = { ensure_installed = { "markdownlint", "markdown-toc" } }, + opts = { ensure_installed = { "markdownlint-cli2", "markdown-toc" } }, }, { "nvimtools/none-ls.nvim", @@ -30,7 +30,7 @@ return { opts = function(_, opts) local nls = require("null-ls") opts.sources = vim.list_extend(opts.sources or {}, { - nls.builtins.diagnostics.markdownlint, + nls.builtins.diagnostics.markdownlint_cli2, }) end, }, @@ -39,7 +39,7 @@ return { optional = true, opts = { linters_by_ft = { - markdown = { "markdownlint" }, + markdown = { "markdownlint-cli2" }, }, }, }, From b292a721bfce1b079428a3a42aa9ea3454c5692d Mon Sep 17 00:00:00 2001 From: Roman Nesytov Date: Sat, 29 Jun 2024 11:42:46 +0300 Subject: [PATCH 157/323] fix(lazygit): fix browsing private git hostings (#3833) ## What is this PR for? Current implementation of `Git Browse` doesn't work with onprem gitlab (and any other git hosting except gitlab, github and bitbucket). With this little fix, it should work with any git hosting. ## Does this PR fix an existing issue? No ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/util/lazygit.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/util/lazygit.lua b/lua/lazyvim/util/lazygit.lua index d69941df..630d009a 100644 --- a/lua/lazyvim/util/lazygit.lua +++ b/lua/lazyvim/util/lazygit.lua @@ -166,7 +166,7 @@ function M.browse() for _, line in ipairs(lines) do local name, url = line:match("(%S+)%s+(%S+)%s+%(fetch%)") if name and url then - if url:find("git@github.com") or url:find("git@bitbucket.org") or url:find("git@gitlab.com") then + if url:find("git@") == 1 then url = url:gsub("git@(%S+):", "https://%1/"):gsub(".git$", "") end table.insert(remotes, { name = name, url = url }) From 566753b8889a6132f2e667606a6a002fdd8847b1 Mon Sep 17 00:00:00 2001 From: Gobinda Goshwami Date: Sat, 29 Jun 2024 14:47:39 +0600 Subject: [PATCH 158/323] fix(edgy): improve edgy.lua bufferline offset logic (#3794) ## What is this PR for? Use already defined Bufferline offsets or use Edgy offset if none are found. Also properly set offset separator position depending on offset/pane location. ## Does this PR fix an existing issue? No ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/ui/edgy.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lua/lazyvim/plugins/extras/ui/edgy.lua b/lua/lazyvim/plugins/extras/ui/edgy.lua index 16b712e2..cb2c7358 100644 --- a/lua/lazyvim/plugins/extras/ui/edgy.lua +++ b/lua/lazyvim/plugins/extras/ui/edgy.lua @@ -152,14 +152,17 @@ return { local get = Offset.get Offset.get = function() if package.loaded.edgy then + local old_offset = get() local layout = require("edgy.config").layout local ret = { left = "", left_size = 0, right = "", right_size = 0 } for _, pos in ipairs({ "left", "right" }) do local sb = layout[pos] + local title = " Sidebar" .. string.rep(" ", sb.bounds.width - 8) if sb and #sb.wins > 0 then - local title = " Sidebar" .. string.rep(" ", sb.bounds.width - 8) - ret[pos] = "%#EdgyTitle#" .. title .. "%*" .. "%#WinSeparator#│%*" - ret[pos .. "_size"] = sb.bounds.width + ret[pos] = old_offset[pos .. "_size"] > 0 and old_offset[pos] + or pos == "left" and ("%#Bold#" .. title .. "%*" .. "%#BufferLineOffsetSeparator#│%*") + or pos == "right" and ("%#BufferLineOffsetSeparator#│%*" .. "%#Bold#" .. title .. "%*") + ret[pos .. "_size"] = old_offset[pos .. "_size"] > 0 and old_offset[pos .. "_size"] or sb.bounds.width end end ret.total_size = ret.left_size + ret.right_size From 0fede4040b15da7e74c6a741132ff3d48634c1ad Mon Sep 17 00:00:00 2001 From: Adrian Wilkins Date: Sat, 29 Jun 2024 10:45:53 +0100 Subject: [PATCH 159/323] feat(java): enable Lombok support in jdtls (#3852) jdtls needs an argument passed to the JVM to load Lombok as an agent. Mason downloads `lombok.jar`so we can use that ## What is this PR for? Configures Lombok support in `jdtls` ; this removes a lot of red underlines in Java projects that use it. Changes this ![image](https://github.com/LazyVim/LazyVim/assets/368399/87dbe37a-7d2c-4410-a600-c702e3097f63) To this ![image](https://github.com/LazyVim/LazyVim/assets/368399/db6ada27-82f3-4052-a0c8-1e62882aaffc) - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. Co-authored-by: Adrian Wilkins --- lua/lazyvim/plugins/extras/lang/java.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/java.lua b/lua/lazyvim/plugins/extras/lang/java.lua index 86be762a..7a47c905 100644 --- a/lua/lazyvim/plugins/extras/lang/java.lua +++ b/lua/lazyvim/plugins/extras/lang/java.lua @@ -71,6 +71,8 @@ return { dependencies = { "folke/which-key.nvim" }, ft = java_filetypes, opts = function() + local mason_registry = require("mason-registry") + local lombok_jar = mason_registry.get_package("jdtls"):get_install_path() .. "/lombok.jar" return { -- How to find the root dir for a given filename. The default comes from -- lspconfig which provides a function specifically for java projects. @@ -91,7 +93,10 @@ return { -- How to run jdtls. This can be overridden to a full java command-line -- if the Python wrapper script doesn't suffice. - cmd = { vim.fn.exepath("jdtls") }, + cmd = { + vim.fn.exepath("jdtls"), + string.format("--jvm-arg=-javaagent:%s", lombok_jar), + }, full_cmd = function(opts) local fname = vim.api.nvim_buf_get_name(0) local root_dir = opts.root_dir(fname) From 501ff407688f11afa70f1476e8f045f713d3141d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 29 Jun 2024 12:19:44 +0200 Subject: [PATCH 160/323] chore(main): release 12.21.0 (#3827) :robot: I have created a release *beep* *boop* --- ## [12.21.0](https://github.com/LazyVim/LazyVim/compare/v12.20.1...v12.21.0) (2024-06-29) ### Features * **extras:** add `overseer.nvim` plugin extra ([#2421](https://github.com/LazyVim/LazyVim/issues/2421)) ([683bf52](https://github.com/LazyVim/LazyVim/commit/683bf52c024306f9c0fccc2b02348692c3f09bfa)) * **extras:** add chezmoi extra ([#2859](https://github.com/LazyVim/LazyVim/issues/2859)) ([88f2541](https://github.com/LazyVim/LazyVim/commit/88f25410e020fe64fe42a94d71f0be3db1b918b4)) * **extras:** switch to markdownlint-cli2 ([#3843](https://github.com/LazyVim/LazyVim/issues/3843)) ([f47d105](https://github.com/LazyVim/LazyVim/commit/f47d105b80dce615a572a13351a137653444d548)) * **java:** enable Lombok support in jdtls ([#3852](https://github.com/LazyVim/LazyVim/issues/3852)) ([0fede40](https://github.com/LazyVim/LazyVim/commit/0fede4040b15da7e74c6a741132ff3d48634c1ad)) ### Bug Fixes * **bufremove:** fix `Cancel` ([#3834](https://github.com/LazyVim/LazyVim/issues/3834)) ([87fe403](https://github.com/LazyVim/LazyVim/commit/87fe403df62fd8b89b886920c4f562da8e162cbe)) * **edgy:** improve edgy.lua bufferline offset logic ([#3794](https://github.com/LazyVim/LazyVim/issues/3794)) ([566753b](https://github.com/LazyVim/LazyVim/commit/566753b8889a6132f2e667606a6a002fdd8847b1)) * **extras:** don't load pkgs when parsing specs for LazyExtras ([3764735](https://github.com/LazyVim/LazyVim/commit/3764735fb20596dfc9cd0707d2830a40004c7f0e)) * **gitsigns:** fix inconsistent signs ([#3830](https://github.com/LazyVim/LazyVim/issues/3830)) ([44ed11c](https://github.com/LazyVim/LazyVim/commit/44ed11c4f8867cdc887fdcba6a22938125a403ee)) * **lazygit:** fix browsing private git hostings ([#3833](https://github.com/LazyVim/LazyVim/issues/3833)) ([b292a72](https://github.com/LazyVim/LazyVim/commit/b292a721bfce1b079428a3a42aa9ea3454c5692d)) * **lint:** make prepend_args opt work when default args is empty ([#3828](https://github.com/LazyVim/LazyVim/issues/3828)) ([ff1b44e](https://github.com/LazyVim/LazyVim/commit/ff1b44e67606080b8b40d066943c55c92856e3c6)) * **neotest:** support adapter key on adapter for playwright ([#3824](https://github.com/LazyVim/LazyVim/issues/3824)) ([e5e8d7a](https://github.com/LazyVim/LazyVim/commit/e5e8d7a8056a8c80456751385e73a4b184bcd436)) * **pick:** set recurse_submodules to false when using `auto` picker. Fixes [#3831](https://github.com/LazyVim/LazyVim/issues/3831), Closes [#3835](https://github.com/LazyVim/LazyVim/issues/3835) ([d6429a5](https://github.com/LazyVim/LazyVim/commit/d6429a5c8ad317057cb852d3cd67ce52e9c30727)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/.release-please-manifest.json | 2 +- CHANGELOG.md | 22 ++++++++++++++++++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index 09905898..f60a6931 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "12.20.1" + ".": "12.21.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 395e7d3d..5ce9ef35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,27 @@ # Changelog +## [12.21.0](https://github.com/LazyVim/LazyVim/compare/v12.20.1...v12.21.0) (2024-06-29) + + +### Features + +* **extras:** add `overseer.nvim` plugin extra ([#2421](https://github.com/LazyVim/LazyVim/issues/2421)) ([683bf52](https://github.com/LazyVim/LazyVim/commit/683bf52c024306f9c0fccc2b02348692c3f09bfa)) +* **extras:** add chezmoi extra ([#2859](https://github.com/LazyVim/LazyVim/issues/2859)) ([88f2541](https://github.com/LazyVim/LazyVim/commit/88f25410e020fe64fe42a94d71f0be3db1b918b4)) +* **extras:** switch to markdownlint-cli2 ([#3843](https://github.com/LazyVim/LazyVim/issues/3843)) ([f47d105](https://github.com/LazyVim/LazyVim/commit/f47d105b80dce615a572a13351a137653444d548)) +* **java:** enable Lombok support in jdtls ([#3852](https://github.com/LazyVim/LazyVim/issues/3852)) ([0fede40](https://github.com/LazyVim/LazyVim/commit/0fede4040b15da7e74c6a741132ff3d48634c1ad)) + + +### Bug Fixes + +* **bufremove:** fix `Cancel` ([#3834](https://github.com/LazyVim/LazyVim/issues/3834)) ([87fe403](https://github.com/LazyVim/LazyVim/commit/87fe403df62fd8b89b886920c4f562da8e162cbe)) +* **edgy:** improve edgy.lua bufferline offset logic ([#3794](https://github.com/LazyVim/LazyVim/issues/3794)) ([566753b](https://github.com/LazyVim/LazyVim/commit/566753b8889a6132f2e667606a6a002fdd8847b1)) +* **extras:** don't load pkgs when parsing specs for LazyExtras ([3764735](https://github.com/LazyVim/LazyVim/commit/3764735fb20596dfc9cd0707d2830a40004c7f0e)) +* **gitsigns:** fix inconsistent signs ([#3830](https://github.com/LazyVim/LazyVim/issues/3830)) ([44ed11c](https://github.com/LazyVim/LazyVim/commit/44ed11c4f8867cdc887fdcba6a22938125a403ee)) +* **lazygit:** fix browsing private git hostings ([#3833](https://github.com/LazyVim/LazyVim/issues/3833)) ([b292a72](https://github.com/LazyVim/LazyVim/commit/b292a721bfce1b079428a3a42aa9ea3454c5692d)) +* **lint:** make prepend_args opt work when default args is empty ([#3828](https://github.com/LazyVim/LazyVim/issues/3828)) ([ff1b44e](https://github.com/LazyVim/LazyVim/commit/ff1b44e67606080b8b40d066943c55c92856e3c6)) +* **neotest:** support adapter key on adapter for playwright ([#3824](https://github.com/LazyVim/LazyVim/issues/3824)) ([e5e8d7a](https://github.com/LazyVim/LazyVim/commit/e5e8d7a8056a8c80456751385e73a4b184bcd436)) +* **pick:** set recurse_submodules to false when using `auto` picker. Fixes [#3831](https://github.com/LazyVim/LazyVim/issues/3831), Closes [#3835](https://github.com/LazyVim/LazyVim/issues/3835) ([d6429a5](https://github.com/LazyVim/LazyVim/commit/d6429a5c8ad317057cb852d3cd67ce52e9c30727)) + ## [12.20.1](https://github.com/LazyVim/LazyVim/compare/v12.20.0...v12.20.1) (2024-06-26) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 059fed1e..febfb59e 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "12.20.1" -- x-release-please-version +M.version = "12.21.0" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From b43ace1ecfbeb87626fbde8973a2717247471b2e Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 29 Jun 2024 15:37:26 +0200 Subject: [PATCH 161/323] fix(git): use current dir when git not found to get a meaningful error message --- lua/lazyvim/util/lazygit.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/util/lazygit.lua b/lua/lazyvim/util/lazygit.lua index 630d009a..2e030cb6 100644 --- a/lua/lazyvim/util/lazygit.lua +++ b/lua/lazyvim/util/lazygit.lua @@ -154,7 +154,7 @@ function M.blame_line(opts) local cursor = vim.api.nvim_win_get_cursor(0) local line = cursor[1] local file = vim.api.nvim_buf_get_name(0) - local root = LazyVim.root.detectors.pattern(0, { ".git" })[1] + local root = LazyVim.root.detectors.pattern(0, { ".git" })[1] or "." local cmd = { "git", "-C", root, "log", "-n", opts.count, "-u", "-L", line .. ",+1:" .. file } return require("lazy.util").float_cmd(cmd, opts) end From 73e72ee21d7673e4040bb99f4de834410219d6cb Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 29 Jun 2024 15:37:48 +0200 Subject: [PATCH 162/323] perf(markdown): don't format with markdown-toc when no toc in the doc --- lua/lazyvim/plugins/extras/lang/markdown.lua | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/markdown.lua b/lua/lazyvim/plugins/extras/lang/markdown.lua index fd7c6723..776ae0d7 100644 --- a/lua/lazyvim/plugins/extras/lang/markdown.lua +++ b/lua/lazyvim/plugins/extras/lang/markdown.lua @@ -14,9 +14,20 @@ return { "stevearc/conform.nvim", optional = true, opts = { + formatters = { + ["markdown-toc"] = { + condition = function(_, ctx) + for _, line in ipairs(vim.api.nvim_buf_get_lines(ctx.buf, 0, -1, false)) do + if line:find("") then + return true + end + end + end, + }, + }, formatters_by_ft = { - ["markdown"] = { { "prettierd", "prettier" }, "markdownlint-cli2", "markdown-toc" }, - ["markdown.mdx"] = { { "prettierd", "prettier" }, "markdownlint-cli2", "markdown-toc" }, + ["markdown"] = { "prettier", "markdownlint-cli2", "markdown-toc" }, + ["markdown.mdx"] = { "prettier", "markdownlint-cli2", "markdown-toc" }, }, }, }, From 72547b809f6cdf25cfe99acd9f126764191ac192 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 29 Jun 2024 17:01:51 +0200 Subject: [PATCH 163/323] chore(main): release 12.21.1 (#3854) :robot: I have created a release *beep* *boop* --- ## [12.21.1](https://github.com/LazyVim/LazyVim/compare/v12.21.0...v12.21.1) (2024-06-29) ### Bug Fixes * **git:** use current dir when git not found to get a meaningful error message ([b43ace1](https://github.com/LazyVim/LazyVim/commit/b43ace1ecfbeb87626fbde8973a2717247471b2e)) ### Performance Improvements * **markdown:** don't format with markdown-toc when no toc in the doc ([73e72ee](https://github.com/LazyVim/LazyVim/commit/73e72ee21d7673e4040bb99f4de834410219d6cb)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/.release-please-manifest.json | 2 +- CHANGELOG.md | 12 ++++++++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index f60a6931..e51c1300 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "12.21.0" + ".": "12.21.1" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ce9ef35..3be5b05e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [12.21.1](https://github.com/LazyVim/LazyVim/compare/v12.21.0...v12.21.1) (2024-06-29) + + +### Bug Fixes + +* **git:** use current dir when git not found to get a meaningful error message ([b43ace1](https://github.com/LazyVim/LazyVim/commit/b43ace1ecfbeb87626fbde8973a2717247471b2e)) + + +### Performance Improvements + +* **markdown:** don't format with markdown-toc when no toc in the doc ([73e72ee](https://github.com/LazyVim/LazyVim/commit/73e72ee21d7673e4040bb99f4de834410219d6cb)) + ## [12.21.0](https://github.com/LazyVim/LazyVim/compare/v12.20.1...v12.21.0) (2024-06-29) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index febfb59e..6aef37ba 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "12.21.0" -- x-release-please-version +M.version = "12.21.1" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From 8c900f92e735e9c7e9af24b97de740390383a137 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 29 Jun 2024 21:01:41 +0200 Subject: [PATCH 164/323] fix(lsp): prevent setting up mason-lspconfig more than once when setting mslp opts --- lua/lazyvim/plugins/lsp/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index fceb3055..5e6f3543 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -5,7 +5,7 @@ return { event = "LazyFile", dependencies = { "mason.nvim", - "williamboman/mason-lspconfig.nvim", + { "williamboman/mason-lspconfig.nvim", config = function() end }, }, ---@class PluginLspOpts opts = function() From ee44b2189827e6a34530ad8b55f214a0a809c045 Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Sat, 29 Jun 2024 22:04:40 +0300 Subject: [PATCH 165/323] feat(cmp): disable `item.menu` for Rust filetypes (#3858) ## What is this PR for? Tries to improve aesthetics for `nvim-cmp` in Rust by disabling `item.menu` since it contains the `return` types that take up too much space. ## Does this PR fix an existing issue? Fixes #3855 ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/coding.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index 6ad614a3..4e79d6dd 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -49,11 +49,14 @@ return { { name = "buffer" }, }), formatting = { - format = function(_, item) + format = function(entry, item) local icons = LazyVim.config.icons.kinds if icons[item.kind] then item.kind = icons[item.kind] .. item.kind end + if entry.context.filetype == "rust" then + item.menu = nil + end return item end, }, From 131187c092cc42768e0a48a3668e91d009a213a0 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 29 Jun 2024 21:19:13 +0200 Subject: [PATCH 166/323] feat: allow a custom path for `lazyvim.json`. Fixes #3856 --- lua/lazyvim/config/init.lua | 4 ++-- lua/lazyvim/util/json.lua | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 6aef37ba..df332811 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -136,6 +136,7 @@ local defaults = { M.json = { version = 6, + path = vim.g.lazyvim_json or vim.fn.stdpath("config") .. "/lazyvim.json", data = { version = nil, ---@type string? news = {}, ---@type table @@ -144,8 +145,7 @@ M.json = { } function M.json.load() - local path = vim.fn.stdpath("config") .. "/lazyvim.json" - local f = io.open(path, "r") + local f = io.open(M.json.path, "r") if f then local data = f:read("*a") f:close() diff --git a/lua/lazyvim/util/json.lua b/lua/lazyvim/util/json.lua index 3abdad75..a823606a 100644 --- a/lua/lazyvim/util/json.lua +++ b/lua/lazyvim/util/json.lua @@ -45,8 +45,7 @@ end function M.save() LazyVim.config.json.data.version = LazyVim.config.json.version - local path = vim.fn.stdpath("config") .. "/lazyvim.json" - local f = io.open(path, "w") + local f = io.open(LazyVim.config.json.path, "w") if f then f:write(LazyVim.json.encode(LazyVim.config.json.data)) f:close() From 85405d65348cac72343d081a81addfb5c8d43743 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 30 Jun 2024 08:19:40 +0200 Subject: [PATCH 167/323] feat(neo-tree): more sane defaults for gitignore and hidden files --- lua/lazyvim/plugins/editor.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index c7ceb4f7..1617d8ce 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -66,6 +66,11 @@ return { bind_to_cwd = false, follow_current_file = { enabled = true }, use_libuv_file_watcher = true, + filtered_items = { + hide_dotfiles = false, + hide_gitignored = true, + hide_by_name = { ".git" }, + }, }, window = { mappings = { From 9a69f27484e0891554599fb417cb42ea65531ad1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 30 Jun 2024 06:20:45 +0000 Subject: [PATCH 168/323] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 9bd0fda5..e834d15d 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 29 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 30 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 47c0e3bb9b930cd31dd2016f8c57fa88df7f66ff Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 30 Jun 2024 08:23:02 +0200 Subject: [PATCH 169/323] chore(main): release 12.22.0 (#3861) :robot: I have created a release *beep* *boop* --- ## [12.22.0](https://github.com/LazyVim/LazyVim/compare/v12.21.1...v12.22.0) (2024-06-30) ### Features * allow a custom path for `lazyvim.json`. Fixes [#3856](https://github.com/LazyVim/LazyVim/issues/3856) ([131187c](https://github.com/LazyVim/LazyVim/commit/131187c092cc42768e0a48a3668e91d009a213a0)) * **cmp:** disable `item.menu` for Rust filetypes ([#3858](https://github.com/LazyVim/LazyVim/issues/3858)) ([ee44b21](https://github.com/LazyVim/LazyVim/commit/ee44b2189827e6a34530ad8b55f214a0a809c045)) * **neo-tree:** more sane defaults for gitignore and hidden files ([85405d6](https://github.com/LazyVim/LazyVim/commit/85405d65348cac72343d081a81addfb5c8d43743)) ### Bug Fixes * **lsp:** prevent setting up mason-lspconfig more than once when setting mslp opts ([8c900f9](https://github.com/LazyVim/LazyVim/commit/8c900f92e735e9c7e9af24b97de740390383a137)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/.release-please-manifest.json | 2 +- CHANGELOG.md | 14 ++++++++++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index e51c1300..b7a916e1 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "12.21.1" + ".": "12.22.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 3be5b05e..6e007a94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [12.22.0](https://github.com/LazyVim/LazyVim/compare/v12.21.1...v12.22.0) (2024-06-30) + + +### Features + +* allow a custom path for `lazyvim.json`. Fixes [#3856](https://github.com/LazyVim/LazyVim/issues/3856) ([131187c](https://github.com/LazyVim/LazyVim/commit/131187c092cc42768e0a48a3668e91d009a213a0)) +* **cmp:** disable `item.menu` for Rust filetypes ([#3858](https://github.com/LazyVim/LazyVim/issues/3858)) ([ee44b21](https://github.com/LazyVim/LazyVim/commit/ee44b2189827e6a34530ad8b55f214a0a809c045)) +* **neo-tree:** more sane defaults for gitignore and hidden files ([85405d6](https://github.com/LazyVim/LazyVim/commit/85405d65348cac72343d081a81addfb5c8d43743)) + + +### Bug Fixes + +* **lsp:** prevent setting up mason-lspconfig more than once when setting mslp opts ([8c900f9](https://github.com/LazyVim/LazyVim/commit/8c900f92e735e9c7e9af24b97de740390383a137)) + ## [12.21.1](https://github.com/LazyVim/LazyVim/compare/v12.21.0...v12.21.1) (2024-06-29) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index df332811..35830062 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "12.21.1" -- x-release-please-version +M.version = "12.22.0" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From 19a8e5089c59297123dc9c65acce561bc3593b94 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 30 Jun 2024 08:46:07 +0200 Subject: [PATCH 170/323] ci: fix --- .github/workflows/ci.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 795d3bd8..93bdaa68 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,7 +1,6 @@ name: CI on: push: - pull_request: jobs: stylua: @@ -15,11 +14,7 @@ jobs: version: latest args: --check . tests: - strategy: - matrix: - # os: [ubuntu-latest, windows-latest] - os: [ubuntu-latest] - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Install Neovim From 06d2749308fd2d530eb41c0c3885bdbfad3bacfc Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 30 Jun 2024 08:47:28 +0200 Subject: [PATCH 171/323] ci: fix --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 93bdaa68..925727e20 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,7 @@ name: CI on: push: + pull_request: jobs: stylua: From 8a6875ab3bc79d5890cf0a65e3ef602c1567fa90 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 30 Jun 2024 11:16:10 +0200 Subject: [PATCH 172/323] perf(markdown): only run markdownlint-cli2 formatter when there are markdownlint diagnostics for the buffer --- lua/lazyvim/plugins/extras/lang/markdown.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lua/lazyvim/plugins/extras/lang/markdown.lua b/lua/lazyvim/plugins/extras/lang/markdown.lua index 776ae0d7..c8424ea5 100644 --- a/lua/lazyvim/plugins/extras/lang/markdown.lua +++ b/lua/lazyvim/plugins/extras/lang/markdown.lua @@ -24,6 +24,14 @@ return { end end, }, + ["markdownlint-cli2"] = { + condition = function(_, ctx) + local diag = vim.tbl_filter(function(d) + return d.source == "markdownlint" + end, vim.diagnostic.get(ctx.buf)) + return #diag > 0 + end, + }, }, formatters_by_ft = { ["markdown"] = { "prettier", "markdownlint-cli2", "markdown-toc" }, From 2bfcd05c621f74b4d735b14b43804a901f17d416 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 30 Jun 2024 17:29:21 +0200 Subject: [PATCH 173/323] revert: feat(neo-tree): more sane defaults for gitignore and hidden files This reverts commit 85405d65348cac72343d081a81addfb5c8d43743. --- lua/lazyvim/plugins/editor.lua | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 1617d8ce..c7ceb4f7 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -66,11 +66,6 @@ return { bind_to_cwd = false, follow_current_file = { enabled = true }, use_libuv_file_watcher = true, - filtered_items = { - hide_dotfiles = false, - hide_gitignored = true, - hide_by_name = { ".git" }, - }, }, window = { mappings = { From 00f53315b59fd35ef05ea74e66423944a2012974 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 30 Jun 2024 17:32:25 +0200 Subject: [PATCH 174/323] chore(main): release 12.22.1 (#3866) :robot: I have created a release *beep* *boop* --- ## [12.22.1](https://github.com/LazyVim/LazyVim/compare/v12.22.0...v12.22.1) (2024-06-30) ### Performance Improvements * **markdown:** only run markdownlint-cli2 formatter when there are markdownlint diagnostics for the buffer ([8a6875a](https://github.com/LazyVim/LazyVim/commit/8a6875ab3bc79d5890cf0a65e3ef602c1567fa90)) ### Reverts * feat(neo-tree): more sane defaults for gitignore and hidden files ([2bfcd05](https://github.com/LazyVim/LazyVim/commit/2bfcd05c621f74b4d735b14b43804a901f17d416)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/.release-please-manifest.json | 2 +- CHANGELOG.md | 12 ++++++++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index b7a916e1..ba1b4d1f 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "12.22.0" + ".": "12.22.1" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e007a94..980ab8ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [12.22.1](https://github.com/LazyVim/LazyVim/compare/v12.22.0...v12.22.1) (2024-06-30) + + +### Performance Improvements + +* **markdown:** only run markdownlint-cli2 formatter when there are markdownlint diagnostics for the buffer ([8a6875a](https://github.com/LazyVim/LazyVim/commit/8a6875ab3bc79d5890cf0a65e3ef602c1567fa90)) + + +### Reverts + +* feat(neo-tree): more sane defaults for gitignore and hidden files ([2bfcd05](https://github.com/LazyVim/LazyVim/commit/2bfcd05c621f74b4d735b14b43804a901f17d416)) + ## [12.22.0](https://github.com/LazyVim/LazyVim/compare/v12.21.1...v12.22.0) (2024-06-30) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 35830062..70bfd0f8 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "12.22.0" -- x-release-please-version +M.version = "12.22.1" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From d23731c50d149769799d90ae8ec4969a79db3628 Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Sun, 30 Jun 2024 20:15:23 +0300 Subject: [PATCH 175/323] fix(neo-tree): remove `branch`, since it obstructs updating to latest version (#3871) ## What is this PR for? `branch` was obstructing from being able to update to latest HEAD like in other plugins. This was necessary when the initial development was being done on this branch and `main` was used for the old stable release, but this is not necessary any more. Also, @folke now you can use `always_show_by_pattern`, which you might find useful to show the git tracked hidden files like you wanted but couldn't do before. ## Does this PR fix an existing issue? No ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/editor.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index c7ceb4f7..2f035f6a 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -3,7 +3,6 @@ return { -- file explorer { "nvim-neo-tree/neo-tree.nvim", - branch = "v3.x", cmd = "Neotree", keys = { { From 78cf6ee024cbf6a17dc8406555eb131994cd8b63 Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Mon, 1 Jul 2024 00:14:00 +0300 Subject: [PATCH 176/323] feat(cmp): attempt for dynamic width and trimming between fields (#3873) ## What is this PR for? Attempt for dynamic width and trimming between fields. Testing was done on my 15.6 laptop screen so maybe values could be raised in dynamic calculation? Also provides a `vim.g.cmp_fixed_width` for the users to be able to define a fixed width in their personal configuration if they'd like to. ## Does this PR fix an existing issue? Attempts to rectify a concern raised in #3858 ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --------- Co-authored-by: Folke Lemaitre --- lua/lazyvim/plugins/coding.lua | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index 4e79d6dd..ffd743b3 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -54,9 +54,18 @@ return { if icons[item.kind] then item.kind = icons[item.kind] .. item.kind end - if entry.context.filetype == "rust" then - item.menu = nil + + local widths = { + abbr = vim.g.cmp_widths and vim.g.cmp_widths.abbr or 40, + menu = vim.g.cmp_widths and vim.g.cmp_widths.menu or 30, + } + + for key, width in pairs(widths) do + if item[key] and vim.fn.strdisplaywidth(item[key]) > width then + item[key] = vim.fn.strcharpart(item[key], 0, width - 1) .. "…" + end end + return item end, }, From 2114a6610f6fc6dea2e4937171429252641bd27d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Jensen?= <53434466+HeadCookie@users.noreply.github.com> Date: Wed, 3 Jul 2024 07:51:13 +0200 Subject: [PATCH 177/323] fix(chezmoi): missing support for fzf file picker (#3888) ## What is this PR for? This fixes an issue with the chezmoi extra that won't work if the LazyVim picker is fzf-lua instead of Telescope. Fx if you have the `editor.fzf` and `util.chezmoi` extras enabled at the same time, trying to open the config from the dashboard will result in the following error because Telescope has been replaced with fzf: ``` E5108: Error executing lua: vim/_editor.lua:0: nvim_exec2(): Vim:E492: Not an editor command: Telescope chezmoi find_files stack traceback: [C]: in function 'nvim_exec2' vim/_editor.lua: in function 'cmd' ...re/nvim/lazy/dashboard-nvim/lua/dashboard/theme/doom.lua:24: in function <...re/nvim/lazy/dashboard-nvim/lua/dashboard/theme/doom.lua:20> ``` This PR fixes the issue by checking which LazyVim picker is in use. Before: https://github.com/LazyVim/LazyVim/assets/53434466/31cade36-1655-438f-9aa8-c3de8fec881f After: https://github.com/LazyVim/LazyVim/assets/53434466/55f7d0c7-9632-4d52-8a6e-dfba17b14ed4 ## Does this PR fix an existing issue? ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/util/chezmoi.lua | 30 ++++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/lua/lazyvim/plugins/extras/util/chezmoi.lua b/lua/lazyvim/plugins/extras/util/chezmoi.lua index f16b5889..56518dfd 100644 --- a/lua/lazyvim/plugins/extras/util/chezmoi.lua +++ b/lua/lazyvim/plugins/extras/util/chezmoi.lua @@ -1,3 +1,27 @@ +local pick_chezmoi = function() + if LazyVim.pick.picker.name == "telescope" then + require("telescope").extensions.chezmoi.find_files() + elseif LazyVim.pick.picker.name == "fzf" then + local fzf_lua = require("fzf-lua") + local results = require("chezmoi.commands").list() + local chezmoi = require("chezmoi.commands") + + local opts = { + fzf_opts = {}, + fzf_colors = true, + actions = { + ["default"] = function(selected) + chezmoi.edit({ + targets = { "~/" .. selected[1] }, + args = { "--watch" }, + }) + end, + }, + } + fzf_lua.fzf_exec(results, opts) + end +end + return { { -- highlighting for chezmoi files template files @@ -12,9 +36,7 @@ return { keys = { { "sz", - function() - require("telescope").extensions.chezmoi.find_files() - end, + pick_chezmoi, desc = "Chezmoi", }, }, @@ -47,7 +69,7 @@ return { optional = true, opts = function(_, opts) local projects = { - action = "Telescope chezmoi find_files", + action = pick_chezmoi, desc = " Config", icon = "", key = "c", From cb9cbd3a374e58f5281eadea3169a4db1e5560c0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 3 Jul 2024 05:52:05 +0000 Subject: [PATCH 178/323] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index e834d15d..e82f824f 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 30 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 July 03 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 1f603f9074118ee9975b2af0308452ca324640e5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 3 Jul 2024 07:55:45 +0200 Subject: [PATCH 179/323] chore(main): release 12.23.0 (#3872) :robot: I have created a release *beep* *boop* --- ## [12.23.0](https://github.com/LazyVim/LazyVim/compare/v12.22.1...v12.23.0) (2024-07-03) ### Features * **cmp:** attempt for dynamic width and trimming between fields ([#3873](https://github.com/LazyVim/LazyVim/issues/3873)) ([78cf6ee](https://github.com/LazyVim/LazyVim/commit/78cf6ee024cbf6a17dc8406555eb131994cd8b63)) ### Bug Fixes * **chezmoi:** missing support for fzf file picker ([#3888](https://github.com/LazyVim/LazyVim/issues/3888)) ([2114a66](https://github.com/LazyVim/LazyVim/commit/2114a6610f6fc6dea2e4937171429252641bd27d)) * **neo-tree:** remove `branch`, since it obstructs updating to latest version ([#3871](https://github.com/LazyVim/LazyVim/issues/3871)) ([d23731c](https://github.com/LazyVim/LazyVim/commit/d23731c50d149769799d90ae8ec4969a79db3628)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/.release-please-manifest.json | 2 +- CHANGELOG.md | 13 +++++++++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index ba1b4d1f..7cdae61f 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "12.22.1" + ".": "12.23.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 980ab8ab..5ca98d5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## [12.23.0](https://github.com/LazyVim/LazyVim/compare/v12.22.1...v12.23.0) (2024-07-03) + + +### Features + +* **cmp:** attempt for dynamic width and trimming between fields ([#3873](https://github.com/LazyVim/LazyVim/issues/3873)) ([78cf6ee](https://github.com/LazyVim/LazyVim/commit/78cf6ee024cbf6a17dc8406555eb131994cd8b63)) + + +### Bug Fixes + +* **chezmoi:** missing support for fzf file picker ([#3888](https://github.com/LazyVim/LazyVim/issues/3888)) ([2114a66](https://github.com/LazyVim/LazyVim/commit/2114a6610f6fc6dea2e4937171429252641bd27d)) +* **neo-tree:** remove `branch`, since it obstructs updating to latest version ([#3871](https://github.com/LazyVim/LazyVim/issues/3871)) ([d23731c](https://github.com/LazyVim/LazyVim/commit/d23731c50d149769799d90ae8ec4969a79db3628)) + ## [12.22.1](https://github.com/LazyVim/LazyVim/compare/v12.22.0...v12.22.1) (2024-06-30) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 70bfd0f8..cab0891c 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "12.22.1" -- x-release-please-version +M.version = "12.23.0" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From fe3d0da5087ecadfee8922fa363d3e84c0ba3461 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 2 Jul 2024 19:02:13 +0200 Subject: [PATCH 180/323] feat(options): jumpoptions=view --- lua/lazyvim/config/options.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/config/options.lua b/lua/lazyvim/config/options.lua index f324be99..5c66966a 100644 --- a/lua/lazyvim/config/options.lua +++ b/lua/lazyvim/config/options.lua @@ -75,6 +75,7 @@ opt.grepformat = "%f:%l:%c:%m" opt.grepprg = "rg --vimgrep" opt.ignorecase = true -- Ignore case opt.inccommand = "nosplit" -- preview incremental substitute +opt.jumpoptions = "view" opt.laststatus = 3 -- global statusline opt.linebreak = true -- Wrap lines at convenient points opt.list = true -- Show some invisible characters (tabs... From b9a8a4ad7f39c8ed3f4febb25dabc9ae24110f98 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 3 Jul 2024 18:00:58 +0200 Subject: [PATCH 181/323] perf(fzf): lazy-load fzf-lua --- lua/lazyvim/plugins/extras/editor/fzf.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/editor/fzf.lua b/lua/lazyvim/plugins/extras/editor/fzf.lua index f53ce57b..24eb52f5 100644 --- a/lua/lazyvim/plugins/extras/editor/fzf.lua +++ b/lua/lazyvim/plugins/extras/editor/fzf.lua @@ -43,7 +43,7 @@ return { recommended = true, { "ibhagwan/fzf-lua", - event = "VeryLazy", + cmd = "FzfLua", opts = function(_, opts) local config = require("fzf-lua.config") local actions = require("fzf-lua.actions") From 455557c1f693c6ced946de2322beceb555161417 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 3 Jul 2024 19:06:43 +0200 Subject: [PATCH 182/323] fix(dials): dials.nvim stopped working after making changes to plugin files --- lua/lazyvim/plugins/extras/editor/dial.lua | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lua/lazyvim/plugins/extras/editor/dial.lua b/lua/lazyvim/plugins/extras/editor/dial.lua index cc262a33..dbc6cdf0 100644 --- a/lua/lazyvim/plugins/extras/editor/dial.lua +++ b/lua/lazyvim/plugins/extras/editor/dial.lua @@ -1,6 +1,4 @@ local M = {} ----@type table> -M.dials_by_ft = {} ---@param increment boolean ---@param g? boolean @@ -9,7 +7,7 @@ function M.dial(increment, g) -- Use visual commands for VISUAL 'v', VISUAL LINE 'V' and VISUAL BLOCK '\22' local is_visual = mode == "v" or mode == "V" or mode == "\22" local func = (increment and "inc" or "dec") .. (g and "_g" or "_") .. (is_visual and "visual" or "normal") - local group = M.dials_by_ft[vim.bo.filetype] or "default" + local group = vim.g.dials_by_ft[vim.bo.filetype] or "default" return require("dial.map")[func](group) end @@ -170,6 +168,6 @@ return { end, config = function(_, opts) require("dial.config").augends:register_group(opts.groups) - M.dials_by_ft = opts.dials_by_ft + vim.g.dials_by_ft = opts.dials_by_ft end, } From 8ddc6f9e16115708e2adb26609a9293ad0e380fd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 3 Jul 2024 21:12:38 +0200 Subject: [PATCH 183/323] chore(main): release 12.24.0 (#3900) :robot: I have created a release *beep* *boop* --- ## [12.24.0](https://github.com/LazyVim/LazyVim/compare/v12.23.0...v12.24.0) (2024-07-03) ### Features * **options:** jumpoptions=view ([fe3d0da](https://github.com/LazyVim/LazyVim/commit/fe3d0da5087ecadfee8922fa363d3e84c0ba3461)) ### Bug Fixes * **dials:** dials.nvim stopped working after making changes to plugin files ([455557c](https://github.com/LazyVim/LazyVim/commit/455557c1f693c6ced946de2322beceb555161417)) ### Performance Improvements * **fzf:** lazy-load fzf-lua ([b9a8a4a](https://github.com/LazyVim/LazyVim/commit/b9a8a4ad7f39c8ed3f4febb25dabc9ae24110f98)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/.release-please-manifest.json | 2 +- CHANGELOG.md | 17 +++++++++++++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index 7cdae61f..ec2ffd23 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "12.23.0" + ".": "12.24.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ca98d5c..82703be0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## [12.24.0](https://github.com/LazyVim/LazyVim/compare/v12.23.0...v12.24.0) (2024-07-03) + + +### Features + +* **options:** jumpoptions=view ([fe3d0da](https://github.com/LazyVim/LazyVim/commit/fe3d0da5087ecadfee8922fa363d3e84c0ba3461)) + + +### Bug Fixes + +* **dials:** dials.nvim stopped working after making changes to plugin files ([455557c](https://github.com/LazyVim/LazyVim/commit/455557c1f693c6ced946de2322beceb555161417)) + + +### Performance Improvements + +* **fzf:** lazy-load fzf-lua ([b9a8a4a](https://github.com/LazyVim/LazyVim/commit/b9a8a4ad7f39c8ed3f4febb25dabc9ae24110f98)) + ## [12.23.0](https://github.com/LazyVim/LazyVim/compare/v12.22.1...v12.23.0) (2024-07-03) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index cab0891c..4ae68480 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "12.23.0" -- x-release-please-version +M.version = "12.24.0" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From d5f3d395f490a252125044d0918267eb18298532 Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Wed, 3 Jul 2024 22:49:21 +0300 Subject: [PATCH 184/323] feat(fzf-lua): preview keymaps for git (#3904) ## What is this PR for? It seems that the preview keymaps set right now only support the builtin previewer. From searching through `fzf-lua` docs, I found [here](https://github.com/ibhagwan/fzf-lua/blob/3b91c1a471160bd8620bdca8f18743d954994daa/README.md?plain=1#L634-L638) that additional mappings should be set for the other previewers such as `git` (otherwise the defaults `` could be used). I chose to use the same mappings for the `fzf` preview keymaps as they serve the same functionality. Please feel free to change if not to your liking. ## Does this PR fix an existing issue? Not an issue but a discussion #3895 ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/editor/fzf.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/lazyvim/plugins/extras/editor/fzf.lua b/lua/lazyvim/plugins/extras/editor/fzf.lua index 24eb52f5..e9b19496 100644 --- a/lua/lazyvim/plugins/extras/editor/fzf.lua +++ b/lua/lazyvim/plugins/extras/editor/fzf.lua @@ -53,6 +53,8 @@ return { config.defaults.keymap.fzf["ctrl-u"] = "half-page-up" config.defaults.keymap.fzf["ctrl-d"] = "half-page-down" config.defaults.keymap.fzf["ctrl-x"] = "jump" + config.defaults.keymap.fzf["ctrl-f"] = "preview-page-down" + config.defaults.keymap.fzf["ctrl-b"] = "preview-page-up" config.defaults.keymap.builtin[""] = "preview-page-down" config.defaults.keymap.builtin[""] = "preview-page-up" From 9acadc7ec289966cf8f4f6c37c348f286ed73ffe Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 4 Jul 2024 15:21:02 +0200 Subject: [PATCH 185/323] fix(fzf): make sure `vim.ui.select` works when fzf is not loaded yet --- lua/lazyvim/plugins/extras/editor/fzf.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lua/lazyvim/plugins/extras/editor/fzf.lua b/lua/lazyvim/plugins/extras/editor/fzf.lua index e9b19496..67acc830 100644 --- a/lua/lazyvim/plugins/extras/editor/fzf.lua +++ b/lua/lazyvim/plugins/extras/editor/fzf.lua @@ -192,6 +192,14 @@ return { require("fzf-lua").setup(opts) require("fzf-lua").register_ui_select(opts.ui_select or nil) end, + init = function() + LazyVim.on_very_lazy(function() + vim.ui.select = function(...) + require("fzf-lua") + return vim.ui.select(...) + end + end) + end, keys = { { "", "", ft = "fzf", mode = "t", nowait = true }, { "", "", ft = "fzf", mode = "t", nowait = true }, From c848cfddef6f4417b133382cae6fda49e8df990c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 4 Jul 2024 13:22:14 +0000 Subject: [PATCH 186/323] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index e82f824f..4dab9be3 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 July 03 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 July 04 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 1bf8050bc4d5d79a89307e2142caa708e033f06d Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 4 Jul 2024 18:13:18 +0200 Subject: [PATCH 187/323] ci: new minit --- tests/{busted.lua => minit.lua} | 3 ++- tests/run | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) rename tests/{busted.lua => minit.lua} (85%) diff --git a/tests/busted.lua b/tests/minit.lua similarity index 85% rename from tests/busted.lua rename to tests/minit.lua index 4e101682..6ae23266 100644 --- a/tests/busted.lua +++ b/tests/minit.lua @@ -4,8 +4,9 @@ vim.env.LAZY_STDPATH = ".tests" load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))() -- Setup lazy.nvim -require("lazy.minit").busted({ +require("lazy.minit").setup({ spec = { + { dir = vim.uv.cwd() }, "LazyVim/starter", "williamboman/mason-lspconfig.nvim", "williamboman/mason.nvim", diff --git a/tests/run b/tests/run index 7c8bb349..8db9d516 100755 --- a/tests/run +++ b/tests/run @@ -1,3 +1,3 @@ #!/bin/sh -nvim -l tests/busted.lua tests -o utfTerminal +nvim -l tests/minit.lua --busted tests -o utfTerminal From 045faec0351ff9a38fda1af9b06bd7f948e84d28 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 4 Jul 2024 18:18:10 +0200 Subject: [PATCH 188/323] feat(ui): use `mini.icons` instead of `nvim-wev-devicons` (#3899) ## What is this PR for? Replace the icon support with the new mini library ## Blockers - [ ] https://github.com/echasnovski/mini.nvim/issues/1007#issuecomment-2206553024 --- lua/lazyvim/plugins/ui.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index a060cc65..fedfabdd 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -303,7 +303,17 @@ return { }, -- icons - { "nvim-tree/nvim-web-devicons", lazy = true }, + { + "echasnovski/mini.icons", + lazy = true, + opts = {}, + init = function() + package.preload["nvim-web-devicons"] = function() + require("mini.icons").mock_nvim_web_devicons() + return package.loaded["nvim-web-devicons"] + end + end, + }, -- ui components { "MunifTanjim/nui.nvim", lazy = true }, From 9c7d3dc75e4ecafe8a6dd6ee8fef0bd7711550ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?George=20Guimar=C3=A3es?= Date: Thu, 4 Jul 2024 11:47:33 -0700 Subject: [PATCH 189/323] feat(erlang): add Erlang language (#3911) I usually work with Elixir codebases, but sometimes I want to browse and code with Erlang codebases, so here is the config I've been using for Erlang. --- lua/lazyvim/plugins/extras/lang/erlang.lua | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 lua/lazyvim/plugins/extras/lang/erlang.lua diff --git a/lua/lazyvim/plugins/extras/lang/erlang.lua b/lua/lazyvim/plugins/extras/lang/erlang.lua new file mode 100644 index 00000000..e905fdcf --- /dev/null +++ b/lua/lazyvim/plugins/extras/lang/erlang.lua @@ -0,0 +1,20 @@ +return { + recommended = function() + return LazyVim.extras.wants({ + ft = { "erlang" }, + root = { "rebar.config", "erlang.mk" }, + }) + end, + { + "neovim/nvim-lspconfig", + opts = { + servers = { + erlangls = {}, + }, + }, + }, + { + "nvim-treesitter/nvim-treesitter", + opts = { ensure_installed = { "erlang" } }, + }, +} From d35a3914bfc0c7c1000184585217d58a81f5da1a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 4 Jul 2024 21:02:19 +0200 Subject: [PATCH 190/323] chore(main): release 12.25.0 (#3905) :robot: I have created a release *beep* *boop* --- ## [12.25.0](https://github.com/LazyVim/LazyVim/compare/v12.24.0...v12.25.0) (2024-07-04) ### Features * **erlang:** add Erlang language ([#3911](https://github.com/LazyVim/LazyVim/issues/3911)) ([9c7d3dc](https://github.com/LazyVim/LazyVim/commit/9c7d3dc75e4ecafe8a6dd6ee8fef0bd7711550ac)) * **fzf-lua:** preview keymaps for git ([#3904](https://github.com/LazyVim/LazyVim/issues/3904)) ([d5f3d39](https://github.com/LazyVim/LazyVim/commit/d5f3d395f490a252125044d0918267eb18298532)) * **ui:** use `mini.icons` instead of `nvim-wev-devicons` ([#3899](https://github.com/LazyVim/LazyVim/issues/3899)) ([045faec](https://github.com/LazyVim/LazyVim/commit/045faec0351ff9a38fda1af9b06bd7f948e84d28)) ### Bug Fixes * **fzf:** make sure `vim.ui.select` works when fzf is not loaded yet ([9acadc7](https://github.com/LazyVim/LazyVim/commit/9acadc7ec289966cf8f4f6c37c348f286ed73ffe)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/.release-please-manifest.json | 2 +- CHANGELOG.md | 14 ++++++++++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index ec2ffd23..d1f4d356 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "12.24.0" + ".": "12.25.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 82703be0..50fe3fb5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [12.25.0](https://github.com/LazyVim/LazyVim/compare/v12.24.0...v12.25.0) (2024-07-04) + + +### Features + +* **erlang:** add Erlang language ([#3911](https://github.com/LazyVim/LazyVim/issues/3911)) ([9c7d3dc](https://github.com/LazyVim/LazyVim/commit/9c7d3dc75e4ecafe8a6dd6ee8fef0bd7711550ac)) +* **fzf-lua:** preview keymaps for git ([#3904](https://github.com/LazyVim/LazyVim/issues/3904)) ([d5f3d39](https://github.com/LazyVim/LazyVim/commit/d5f3d395f490a252125044d0918267eb18298532)) +* **ui:** use `mini.icons` instead of `nvim-wev-devicons` ([#3899](https://github.com/LazyVim/LazyVim/issues/3899)) ([045faec](https://github.com/LazyVim/LazyVim/commit/045faec0351ff9a38fda1af9b06bd7f948e84d28)) + + +### Bug Fixes + +* **fzf:** make sure `vim.ui.select` works when fzf is not loaded yet ([9acadc7](https://github.com/LazyVim/LazyVim/commit/9acadc7ec289966cf8f4f6c37c348f286ed73ffe)) + ## [12.24.0](https://github.com/LazyVim/LazyVim/compare/v12.23.0...v12.24.0) (2024-07-03) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 4ae68480..9909143b 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "12.24.0" -- x-release-please-version +M.version = "12.25.0" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From 8f74db318ccc9f0bc363133933e7435af3bdcef9 Mon Sep 17 00:00:00 2001 From: jyuan0 Date: Fri, 5 Jul 2024 02:22:38 -0400 Subject: [PATCH 191/323] refactor(trouble): move options in keymaps for lsp and symbols to `opts` (#3917) ## What is this PR for? A user won't also have to override the keymaps if they set options for `Trouble lsp` or `symbols` in `opts` (assuming they want the mode to always open with certain options). ## Does this PR fix an existing issue? No. ## Checklist - [ x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. ---- The default for `Trouble symbols` already seems to be on the right, and neither lsp/symbols auto-focuses, so I left these out. --- lua/lazyvim/plugins/editor.lua | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 2f035f6a..fa5d676e 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -256,16 +256,18 @@ return { { "folke/trouble.nvim", cmd = { "Trouble" }, - opts = {}, + opts = { + modes = { + lsp = { + win = { position = "right" }, + }, + }, + }, keys = { { "xx", "Trouble diagnostics toggle", desc = "Diagnostics (Trouble)" }, { "xX", "Trouble diagnostics toggle filter.buf=0", desc = "Buffer Diagnostics (Trouble)" }, - { "cs", "Trouble symbols toggle focus=false", desc = "Symbols (Trouble)" }, - { - "cS", - "Trouble lsp toggle focus=false win.position=right", - desc = "LSP references/definitions/... (Trouble)", - }, + { "cs", "Trouble symbols toggle", desc = "Symbols (Trouble)" }, + { "cS", "Trouble lsp toggle", desc = "LSP references/definitions/... (Trouble)" }, { "xL", "Trouble loclist toggle", desc = "Location List (Trouble)" }, { "xQ", "Trouble qflist toggle", desc = "Quickfix List (Trouble)" }, { From fb59a9feb024ce10f4bd6f511e9155e373a5bbc3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 5 Jul 2024 06:23:43 +0000 Subject: [PATCH 192/323] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 4dab9be3..4d16f66e 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 July 04 +*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 July 05 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 51e99dfba104af54947dcb960f277d739db4280c Mon Sep 17 00:00:00 2001 From: dotfrag <17456867+dotfrag@users.noreply.github.com> Date: Fri, 5 Jul 2024 10:15:57 +0300 Subject: [PATCH 193/323] fix(project): properly close window after changing directory (#3919) ## What is this PR for? In project extra, when using `` in the project selection menu to change directory, the window used to show the command's exit code would not close. This fixes it. ## Does this PR fix an existing issue? N/A. ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/util/project.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/util/project.lua b/lua/lazyvim/plugins/extras/util/project.lua index ec5ae386..77705f37 100644 --- a/lua/lazyvim/plugins/extras/util/project.lua +++ b/lua/lazyvim/plugins/extras/util/project.lua @@ -62,7 +62,7 @@ pick = function() local path = selected[1] local ok = project.set_pwd(path) if ok then - vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("", true, false, true), "n", true) + vim.api.nvim_win_close(0, false) LazyVim.info("Change project dir to " .. path) end end, From 76b41cdec421668dd8078e43184674c783554044 Mon Sep 17 00:00:00 2001 From: cbosvik <132846580+cbosvik@users.noreply.github.com> Date: Fri, 5 Jul 2024 09:20:18 +0200 Subject: [PATCH 194/323] feat(util): rest-client (#3915) ## What is this PR for? Kulala is a minimal REST-client implementation that allows you to make HTTP requests from within Neovim ## Does this PR fix an existing issue? No but simplifies life ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/util/rest.lua | 25 ++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 lua/lazyvim/plugins/extras/util/rest.lua diff --git a/lua/lazyvim/plugins/extras/util/rest.lua b/lua/lazyvim/plugins/extras/util/rest.lua new file mode 100644 index 00000000..61092ca6 --- /dev/null +++ b/lua/lazyvim/plugins/extras/util/rest.lua @@ -0,0 +1,25 @@ +vim.filetype.add({ + extension = { + ["http"] = "http", + }, +}) +return { + { + "mistweaverco/kulala.nvim", + ft = "http", + keys = { + { "R", "", desc = "+Rest" }, + { "Rs", "lua require('kulala').run()", desc = "Send the request" }, + { "Rt", "lua require('kulala').toggle_view()", desc = "Toggle headers/body" }, + { "Rp", "lua require('kulala').jump_prev()", desc = "Jump to previous request" }, + { "Rn", "lua require('kulala').jump_next()", desc = "Jump to next request" }, + }, + opts = {}, + }, + { + "nvim-treesitter/nvim-treesitter", + opts = { + ensure_installed = { "http", "graphql" }, + }, + }, +} From f64bbd29fb279ba672ce1fc9a79b06ecc4237c87 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 5 Jul 2024 14:56:49 +0200 Subject: [PATCH 195/323] feat(dial): yaml support --- lua/lazyvim/plugins/extras/editor/dial.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lua/lazyvim/plugins/extras/editor/dial.lua b/lua/lazyvim/plugins/extras/editor/dial.lua index dbc6cdf0..5b01e32e 100644 --- a/lua/lazyvim/plugins/extras/editor/dial.lua +++ b/lua/lazyvim/plugins/extras/editor/dial.lua @@ -108,6 +108,7 @@ return { scss = "css", typescript = "typescript", typescriptreact = "typescript", + yaml = "yaml", }, groups = { default = { @@ -124,6 +125,11 @@ return { weekdays, months, }, + yaml = { + augend.integer.alias.decimal, -- nonnegative and negative decimal number + augend.constant.alias.bool, -- boolean value (true <-> false) + ordinal_numbers, + }, css = { augend.integer.alias.decimal, -- nonnegative and negative decimal number augend.hexcolor.new({ From 6eb8cacd0f84a73f5232034d809c6dfedd4e6e95 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 5 Jul 2024 15:31:26 +0200 Subject: [PATCH 196/323] ci: update --- .github/dependabot.yml | 9 +--- .github/workflows/ci.yml | 80 ++++------------------------------- .github/workflows/labeler.yml | 10 ++--- .github/workflows/pr.yml | 35 +++------------ .github/workflows/stale.yml | 25 ++--------- .gitignore | 3 +- scripts/test | 3 ++ selene.toml | 4 ++ tests/run | 3 -- vim.toml | 21 +++++++++ 10 files changed, 52 insertions(+), 141 deletions(-) create mode 100755 scripts/test create mode 100644 selene.toml delete mode 100755 tests/run create mode 100644 vim.toml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 0d08e261..5ace4600 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,11 +1,6 @@ -# To get started with Dependabot version updates, you'll need to specify which -# package ecosystems to update and where the package manifests are located. -# Please see the documentation for all configuration options: -# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file - version: 2 updates: - - package-ecosystem: "github-actions" # See documentation for possible values - directory: "/" # Location of package manifests + - package-ecosystem: "github-actions" + directory: "/" schedule: interval: "weekly" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 925727e20..96993304 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,78 +1,14 @@ name: CI + on: push: + branches: [main, master] pull_request: jobs: - stylua: - name: Stylua Formatting - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: JohnnyMorganz/stylua-action@v4 - with: - token: ${{ secrets.GITHUB_TOKEN }} - version: latest - args: --check . - tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install Neovim - shell: bash - run: | - mkdir -p /tmp/nvim - wget -q https://github.com/neovim/neovim/releases/download/nightly/nvim.appimage -O /tmp/nvim/nvim.appimage - cd /tmp/nvim - chmod a+x ./nvim.appimage - ./nvim.appimage --appimage-extract - echo "/tmp/nvim/squashfs-root/usr/bin/" >> $GITHUB_PATH - - name: Run Tests - run: | - nvim --version - [ ! -d tests ] && exit 0 - ./tests/run - docs: - runs-on: ubuntu-latest - needs: tests - if: ${{ github.ref == 'refs/heads/main' && github.repository_owner == 'LazyVim' }} - steps: - - uses: actions/checkout@v4 - - name: panvimdoc - uses: kdheepak/panvimdoc@main - with: - vimdoc: LazyVim - version: "Neovim >= 0.9.0" - demojify: true - treesitter: true - - name: Push changes - uses: stefanzweifel/git-auto-commit-action@v5 - with: - commit_message: "chore(build): auto-generate vimdoc" - commit_user_name: "github-actions[bot]" - commit_user_email: "github-actions[bot]@users.noreply.github.com" - commit_author: "github-actions[bot] " - release: - name: release - if: ${{ github.ref == 'refs/heads/main' && github.repository_owner == 'LazyVim' }} - needs: - - docs - - tests - runs-on: ubuntu-latest - steps: - - uses: googleapis/release-please-action@v4 - id: release - with: - 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 }} - run: | - git config user.name github-actions[bot] - git config user.email github-actions[bot]@users.noreply.github.com - git remote add gh-token "https://${{ secrets.GITHUB_TOKEN }}@github.com/google-github-actions/release-please-action.git" - git tag -d stable || true - git push origin :stable || true - git tag -a stable -m "Last Stable Release" - git push origin stable + ci: + uses: folke/github/.github/workflows/ci.yml@main + secrets: inherit + with: + plugin: LazyVim + repo: LazyVim/LazyVim diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 52474c6a..0908727b 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -1,12 +1,8 @@ -name: "Pull Request Labeler" +name: "PR Labeler" on: - pull_request_target jobs: labeler: - permissions: - contents: read - pull-requests: write - runs-on: ubuntu-latest - steps: - - uses: actions/labeler@v5 + uses: folke/github/.github/workflows/labeler.yml@main + secrets: inherit diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 0401a4d8..6d9df366 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -1,4 +1,4 @@ -name: "Lint PR" +name: PR Title on: pull_request_target: @@ -6,36 +6,13 @@ on: - opened - edited - synchronize + - reopened + - ready_for_review permissions: pull-requests: read jobs: - main: - name: Validate PR title - runs-on: ubuntu-latest - steps: - - uses: amannn/action-semantic-pull-request@v5 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - requireScope: true - subjectPattern: ^(?![A-Z]).+$ - scopes: | - .+ - types: | - build - chore - ci - docs - feat - fix - merge - perf - refactor - revert - style - test - wip - ignoreLabels: | - autorelease: pending + pr-title: + uses: folke/github/.github/workflows/pr.yml@main + secrets: inherit diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 9ebbb312..a0c704be 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -1,27 +1,10 @@ -name: Close stale issues and PRs +name: Stale Issues & PRs on: - workflow_dispatch: schedule: - cron: "30 1 * * *" jobs: - stale: - runs-on: ubuntu-latest - steps: - - uses: actions/stale@v9 - with: - operations-per-run: 300 - # default stale time - days-before-stale: 30 - days-before-close: 7 - # never stale pull requests - # days-before-pr-stale: -1 - days-before-pr-close: -1 - # exclude issues with certain labels - exempt-issue-labels: pinned,wip,security,notice - # never stale issues attached to a milestone - # exempt-all-milestones: true - stale-issue-message: "This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days." - stale-pr-message: "This PR is stale because it has been open 60 days with no activity." - close-issue-message: "This issue was closed because it has been stalled for 7 days with no activity." + ci: + uses: folke/github/.github/workflows/stale.yml@main + secrets: inherit diff --git a/.gitignore b/.gitignore index cc5457ab..9e2d3592 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,7 @@ tt.* +foo.* .tests doc/tags debug .repro -foo.* *.log -data diff --git a/scripts/test b/scripts/test new file mode 100755 index 00000000..4baf6215 --- /dev/null +++ b/scripts/test @@ -0,0 +1,3 @@ +#!/bin/env bash + +nvim -l tests/minit.lua --busted tests -o utfTerminal "$@" diff --git a/selene.toml b/selene.toml new file mode 100644 index 00000000..5867a2a2 --- /dev/null +++ b/selene.toml @@ -0,0 +1,4 @@ +std="vim" + +[lints] +mixed_table="allow" diff --git a/tests/run b/tests/run deleted file mode 100755 index 8db9d516..00000000 --- a/tests/run +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -nvim -l tests/minit.lua --busted tests -o utfTerminal diff --git a/vim.toml b/vim.toml new file mode 100644 index 00000000..df7e67e6 --- /dev/null +++ b/vim.toml @@ -0,0 +1,21 @@ +[selene] +base = "lua51" +name = "vim" + +[vim] +any = true + +[jit] +any = true + +[assert] +any = true + +[describe] +any = true + +[it] +any = true + +[before_each.args] +any = true From d71545640119d2cff98b5ea0811bb949471e1bdf Mon Sep 17 00:00:00 2001 From: folke Date: Fri, 5 Jul 2024 13:32:45 +0000 Subject: [PATCH 197/323] chore(build): auto-generate docs --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 4d16f66e..fcacb381 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 July 05 +*LazyVim.txt* For Neovim Last change: 2024 July 05 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 4192d9578d1946deba76efd1a0ec36e4ba0e1bbf Mon Sep 17 00:00:00 2001 From: dotfrag <17456867+dotfrag@users.noreply.github.com> Date: Fri, 5 Jul 2024 17:08:52 +0300 Subject: [PATCH 198/323] fix(dial): move date related augends to default group (#3927) ## What is this PR for? Move augends `ordinal_numbers`, `weekdays` and `months` to the default group, making them available to all filetypes. I don't think there is a concrete reason to restrict them to specific filetypes. ## Does this PR fix an existing issue? N/A. ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/editor/dial.lua | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/lua/lazyvim/plugins/extras/editor/dial.lua b/lua/lazyvim/plugins/extras/editor/dial.lua index 5b01e32e..5d2dcaa1 100644 --- a/lua/lazyvim/plugins/extras/editor/dial.lua +++ b/lua/lazyvim/plugins/extras/editor/dial.lua @@ -115,20 +115,19 @@ return { augend.integer.alias.decimal, -- nonnegative decimal number (0, 1, 2, 3, ...) augend.integer.alias.hex, -- nonnegative hex number (0x01, 0x1a1f, etc.) augend.date.alias["%Y/%m/%d"], -- date (2022/02/19, etc.) + ordinal_numbers, + weekdays, + months, }, typescript = { augend.integer.alias.decimal, -- nonnegative and negative decimal number augend.constant.alias.bool, -- boolean value (true <-> false) logical_alias, augend.constant.new({ elements = { "let", "const" } }), - ordinal_numbers, - weekdays, - months, }, yaml = { augend.integer.alias.decimal, -- nonnegative and negative decimal number augend.constant.alias.bool, -- boolean value (true <-> false) - ordinal_numbers, }, css = { augend.integer.alias.decimal, -- nonnegative and negative decimal number @@ -141,9 +140,6 @@ return { }, markdown = { augend.misc.alias.markdown_header, - ordinal_numbers, - weekdays, - months, }, json = { augend.integer.alias.decimal, -- nonnegative and negative decimal number @@ -157,17 +153,11 @@ return { word = true, -- if false, "sand" is incremented into "sor", "doctor" into "doctand", etc. cyclic = true, -- "or" is incremented into "and". }), - ordinal_numbers, - weekdays, - months, }, python = { augend.integer.alias.decimal, -- nonnegative and negative decimal number capitalized_boolean, logical_alias, - ordinal_numbers, - weekdays, - months, }, }, } From 502dac1d9aed71aaa9be8c08a4312622742d47f3 Mon Sep 17 00:00:00 2001 From: ~hedy Date: Fri, 5 Jul 2024 22:10:46 +0800 Subject: [PATCH 199/323] fix(outline): use the correct symbols and filter config format (#3924) ## What is this PR for? The symbols-outline extra was removed in favor of outline.nvim in #2535 (thanks!), but the configuration for symbols in outline.nvim [is not backwards-compatible](https://github.com/hedyhli/outline.nvim/issues/12). This fixes the configuration for the symbols icons and filter to be usable by outline.nvim. ## Does this PR fix an existing issue? It doesn't seem like anyone has encountered this issue, but I can confirm that the config currently used by LazyVim is incorrect. The symbols table is at `symbols` for symbols-outline.nvim, but it's now at `symbols.icons` for outline.nvim. There is no such `symbols_blacklist` key. Instead, `symbols.filter` is used, which is a kind of "whitelist". Coincidentally, outline.nvim fully supports the LazyVim `kind_filter` config table structure. It can either be a list of strings (kinds), or a list of strings for each filetype key. Setting to nil or false makes it so all symbols are included, just like in LazyVim. See [the docs on the `symbols.filter`](https://github.com/hedyhli/outline.nvim?tab=readme-ov-file#symbols-table) structure. ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/editor/outline.lua | 25 +++++++------------ 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/lua/lazyvim/plugins/extras/editor/outline.lua b/lua/lazyvim/plugins/extras/editor/outline.lua index 575d6ec6..e9aad2a0 100644 --- a/lua/lazyvim/plugins/extras/editor/outline.lua +++ b/lua/lazyvim/plugins/extras/editor/outline.lua @@ -14,28 +14,21 @@ return { opts = function() local defaults = require("outline.config").defaults local opts = { - symbols = {}, - symbol_blacklist = {}, + symbols = { + icons = {}, + filter = LazyVim.config.kind_filter, + }, keymaps = { up_and_jump = "", down_and_jump = "", }, } - local filter = LazyVim.config.kind_filter - if type(filter) == "table" then - filter = filter.default - if type(filter) == "table" then - for kind, symbol in pairs(defaults.symbols) do - opts.symbols[kind] = { - icon = LazyVim.config.icons.kinds[kind] or symbol.icon, - hl = symbol.hl, - } - if not vim.tbl_contains(filter, kind) then - table.insert(opts.symbol_blacklist, kind) - end - end - end + for kind, symbol in pairs(defaults.symbols.icons) do + opts.symbols.icons[kind] = { + icon = LazyVim.config.icons.kinds[kind] or symbol.icon, + hl = symbol.hl, + } end return opts end, From 4b0f720457fbbf624406a540b42e9ad7f2e50a77 Mon Sep 17 00:00:00 2001 From: Ray Guo Date: Sat, 6 Jul 2024 00:12:04 +1000 Subject: [PATCH 200/323] feat(vue): enabled hybrid mode to avoid 2 typescript lsp running at same time (#3908) ## What is this PR for? At the moment, the config for vue set hybrid mode to `false` which volar will run a typescript server under the hook. ( hybrid mode false is the takeover mode in v1, was introduced in `2.0.7` see more information here: https://github.com/vuejs/language-tools/pull/4119 ). However, another vtsls with vue language plugin also attached to vue files, this will cause two typescript server running at the same time. It can be very easily observed with tools like `htop` volar and vtsls will have similar memory usage which is abnormal because volar should be very light by itself. This will introduce issues like duplicate diagnostics, see https://github.com/vuejs/language-tools/issues/4159#issuecomment-2208101079 In this pull request, I set the hybrid mode to true as default because the hybrid mode is the "correct" way moving forward, thus it would be more stable. Let me know if you feel it should stay as `false` to be default. ## Does this PR fix an existing issue? No existing issue. ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/lang/vue.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/vue.lua b/lua/lazyvim/plugins/extras/lang/vue.lua index cd2fe4f1..088ce6a9 100644 --- a/lua/lazyvim/plugins/extras/lang/vue.lua +++ b/lua/lazyvim/plugins/extras/lang/vue.lua @@ -22,7 +22,7 @@ return { volar = { init_options = { vue = { - hybridMode = false, + hybridMode = true, }, }, }, From 0471ca14cae4fd249a848a30855e8cfb39be9dbc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 5 Jul 2024 16:13:20 +0200 Subject: [PATCH 201/323] chore(main): release 12.26.0 (#3920) :robot: I have created a release *beep* *boop* --- ## [12.26.0](https://github.com/LazyVim/LazyVim/compare/v12.25.0...v12.26.0) (2024-07-05) ### Features * **dial:** yaml support ([f64bbd2](https://github.com/LazyVim/LazyVim/commit/f64bbd29fb279ba672ce1fc9a79b06ecc4237c87)) * **util:** rest-client ([#3915](https://github.com/LazyVim/LazyVim/issues/3915)) ([76b41cd](https://github.com/LazyVim/LazyVim/commit/76b41cdec421668dd8078e43184674c783554044)) * **vue:** enabled hybrid mode to avoid 2 typescript lsp running at same time ([#3908](https://github.com/LazyVim/LazyVim/issues/3908)) ([4b0f720](https://github.com/LazyVim/LazyVim/commit/4b0f720457fbbf624406a540b42e9ad7f2e50a77)) ### Bug Fixes * **dial:** move date related augends to default group ([#3927](https://github.com/LazyVim/LazyVim/issues/3927)) ([4192d95](https://github.com/LazyVim/LazyVim/commit/4192d9578d1946deba76efd1a0ec36e4ba0e1bbf)) * **outline:** use the correct symbols and filter config format ([#3924](https://github.com/LazyVim/LazyVim/issues/3924)) ([502dac1](https://github.com/LazyVim/LazyVim/commit/502dac1d9aed71aaa9be8c08a4312622742d47f3)) * **project:** properly close window after changing directory ([#3919](https://github.com/LazyVim/LazyVim/issues/3919)) ([51e99df](https://github.com/LazyVim/LazyVim/commit/51e99dfba104af54947dcb960f277d739db4280c)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/.release-please-manifest.json | 2 +- CHANGELOG.md | 16 ++++++++++++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index d1f4d356..996c75eb 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "12.25.0" + ".": "12.26.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 50fe3fb5..4d84069a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## [12.26.0](https://github.com/LazyVim/LazyVim/compare/v12.25.0...v12.26.0) (2024-07-05) + + +### Features + +* **dial:** yaml support ([f64bbd2](https://github.com/LazyVim/LazyVim/commit/f64bbd29fb279ba672ce1fc9a79b06ecc4237c87)) +* **util:** rest-client ([#3915](https://github.com/LazyVim/LazyVim/issues/3915)) ([76b41cd](https://github.com/LazyVim/LazyVim/commit/76b41cdec421668dd8078e43184674c783554044)) +* **vue:** enabled hybrid mode to avoid 2 typescript lsp running at same time ([#3908](https://github.com/LazyVim/LazyVim/issues/3908)) ([4b0f720](https://github.com/LazyVim/LazyVim/commit/4b0f720457fbbf624406a540b42e9ad7f2e50a77)) + + +### Bug Fixes + +* **dial:** move date related augends to default group ([#3927](https://github.com/LazyVim/LazyVim/issues/3927)) ([4192d95](https://github.com/LazyVim/LazyVim/commit/4192d9578d1946deba76efd1a0ec36e4ba0e1bbf)) +* **outline:** use the correct symbols and filter config format ([#3924](https://github.com/LazyVim/LazyVim/issues/3924)) ([502dac1](https://github.com/LazyVim/LazyVim/commit/502dac1d9aed71aaa9be8c08a4312622742d47f3)) +* **project:** properly close window after changing directory ([#3919](https://github.com/LazyVim/LazyVim/issues/3919)) ([51e99df](https://github.com/LazyVim/LazyVim/commit/51e99dfba104af54947dcb960f277d739db4280c)) + ## [12.25.0](https://github.com/LazyVim/LazyVim/compare/v12.24.0...v12.25.0) (2024-07-04) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 9909143b..79e9796b 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "12.25.0" -- x-release-please-version +M.version = "12.26.0" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From bb4d4cbd5c9cf1d4e00995dfef261015a5da5abf Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 5 Jul 2024 18:58:25 +0200 Subject: [PATCH 202/323] ci: update --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- .github/workflows/ci.yml | 1 + .gitignore | 13 +++++++------ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index c1b3225d..2a953b1f 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -7,7 +7,7 @@ ## Checklist diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 96993304..51939e69 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,3 +12,4 @@ jobs: with: plugin: LazyVim repo: LazyVim/LazyVim + tests: true diff --git a/.gitignore b/.gitignore index 9e2d3592..2b0bb7a8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,8 @@ -tt.* -foo.* -.tests -doc/tags -debug -.repro *.log +.repro +.tests +build +debug +doc/tags +foo.* +tt.* From a915a5d7e132c9e24cb32bdcd597ec4398bc2a80 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 5 Jul 2024 19:08:52 +0200 Subject: [PATCH 203/323] ci: fix urls --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 2103ea51..1a3f3100 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -6,7 +6,7 @@ body: - type: markdown attributes: value: | - **Before** reporting an issue, make sure to read the [documentation](https://github.com/folke/LazyVim) and search [existing issues](https://github.com/folke/LazyVim/issues). Usage questions such as ***"How do I...?"*** belong in [Discussions](https://github.com/folke/LazyVim/discussions) and will be closed. + **Before** reporting an issue, make sure to read the [documentation](https://github.com/LazyVim/LazyVim) and search [existing issues](https://github.com/LazyVim/LazyVim/issues). Usage questions such as ***"How do I...?"*** belong in [Discussions](https://github.com/LazyVim/LazyVim/discussions) and will be closed. - type: checkboxes attributes: label: Did you check docs and existing issues? From 330d2e470b79eb31f884685b331d5d255776de90 Mon Sep 17 00:00:00 2001 From: Farzad Majidfayyaz Date: Fri, 5 Jul 2024 13:34:44 -0400 Subject: [PATCH 204/323] fix(lualine): use the new ministarter file type to disable in mini.starter (#3929) ## What is this PR for? `mini.starter` recently had a breaking change to set the file type to `ministarter` instead of the old `starter`; so, `lualine` is enabled in the dashboard because it's using the old file type. ## Does this PR fix an existing issue? No. ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/ui.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index fedfabdd..f81296ea 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -120,7 +120,7 @@ return { options = { theme = "auto", globalstatus = vim.o.laststatus == 3, - disabled_filetypes = { statusline = { "dashboard", "alpha", "starter" } }, + disabled_filetypes = { statusline = { "dashboard", "alpha", "ministarter" } }, }, sections = { lualine_a = { "mode" }, From 5f952bb9d6927bdc6a4411dc6b1002fa47b3371d Mon Sep 17 00:00:00 2001 From: Dronakurl <76913264+Dronakurl@users.noreply.github.com> Date: Sat, 6 Jul 2024 09:56:19 +0200 Subject: [PATCH 205/323] fix(mini.starter): lazyvim startuptime in mini.starter (#3935) ## What is this PR for? In a fresh install of lazyvim (with` neovim nightly or stable), the startup time is not shown in the mini.starter extra. This fixes it. The filetype name has changed in mini.starter https://github.com/echasnovski/mini.starter/commit/394994b2bec10a997c69575825d5c444957b9ff9 ## Does this PR fix an existing issue? Did not find an issue for it. ## Checklist - [ ] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/ui/mini-starter.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/ui/mini-starter.lua b/lua/lazyvim/plugins/extras/ui/mini-starter.lua index ac2f3aab..6407345c 100644 --- a/lua/lazyvim/plugins/extras/ui/mini-starter.lua +++ b/lua/lazyvim/plugins/extras/ui/mini-starter.lua @@ -69,7 +69,7 @@ return { local pad_footer = string.rep(" ", 8) starter.config.footer = pad_footer .. "⚡ Neovim loaded " .. stats.count .. " plugins in " .. ms .. "ms" -- INFO: based on @echasnovski's recommendation (thanks a lot!!!) - if vim.bo[ev.buf].filetype == "starter" then + if vim.bo[ev.buf].filetype == "ministarter" then pcall(starter.refresh) end end, From 3d410407bee6980b460d5c9c6422a4a6c0245adf Mon Sep 17 00:00:00 2001 From: folke Date: Sat, 6 Jul 2024 07:56:55 +0000 Subject: [PATCH 206/323] chore(build): auto-generate docs --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index fcacb381..239a5792 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2024 July 05 +*LazyVim.txt* For Neovim Last change: 2024 July 06 ============================================================================== Table of Contents *LazyVim-table-of-contents* From ab2ff2e4366a086fb2885455c3b81f48ff7d1fc0 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 6 Jul 2024 11:45:21 +0200 Subject: [PATCH 207/323] ci: update --- .github/workflows/update.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/workflows/update.yml diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml new file mode 100644 index 00000000..2177a50b --- /dev/null +++ b/.github/workflows/update.yml @@ -0,0 +1,12 @@ +name: Update Repo + +on: + workflow_dispatch: + schedule: + # Run every hour + - cron: "0 * * * *" + +jobs: + ci: + uses: folke/github/.github/workflows/update.yml@main + secrets: inherit From e9857446ce9b0d31b04683efd120fe7f6a659366 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 6 Jul 2024 12:12:32 +0200 Subject: [PATCH 208/323] chore(main): release 12.26.1 (#3930) :robot: I have created a release *beep* *boop* --- ## [12.26.1](https://github.com/LazyVim/LazyVim/compare/v12.26.0...v12.26.1) (2024-07-06) ### Bug Fixes * **lualine:** use the new ministarter file type to disable in mini.starter ([#3929](https://github.com/LazyVim/LazyVim/issues/3929)) ([330d2e4](https://github.com/LazyVim/LazyVim/commit/330d2e470b79eb31f884685b331d5d255776de90)) * **mini.starter:** lazyvim startuptime in mini.starter ([#3935](https://github.com/LazyVim/LazyVim/issues/3935)) ([5f952bb](https://github.com/LazyVim/LazyVim/commit/5f952bb9d6927bdc6a4411dc6b1002fa47b3371d)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/.release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index 996c75eb..d571892c 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "12.26.0" + ".": "12.26.1" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d84069a..27ab1b71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [12.26.1](https://github.com/LazyVim/LazyVim/compare/v12.26.0...v12.26.1) (2024-07-06) + + +### Bug Fixes + +* **lualine:** use the new ministarter file type to disable in mini.starter ([#3929](https://github.com/LazyVim/LazyVim/issues/3929)) ([330d2e4](https://github.com/LazyVim/LazyVim/commit/330d2e470b79eb31f884685b331d5d255776de90)) +* **mini.starter:** lazyvim startuptime in mini.starter ([#3935](https://github.com/LazyVim/LazyVim/issues/3935)) ([5f952bb](https://github.com/LazyVim/LazyVim/commit/5f952bb9d6927bdc6a4411dc6b1002fa47b3371d)) + ## [12.26.0](https://github.com/LazyVim/LazyVim/compare/v12.25.0...v12.26.0) (2024-07-05) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 79e9796b..7be8f511 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "12.26.0" -- x-release-please-version +M.version = "12.26.1" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From d8958d78b50b50fd5fc76db93701659a9cf1af57 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 6 Jul 2024 15:00:04 +0200 Subject: [PATCH 209/323] chore(update): update repository (#3938) Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action Co-authored-by: folke <292349+folke@users.noreply.github.com> --- .github/ISSUE_TEMPLATE/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index f861a282..1534cf54 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,5 +1,5 @@ blank_issues_enabled: false contact_links: - - name: Ask a question or start a discussion + - name: Ask a question url: https://github.com/LazyVim/LazyVim/discussions about: Use Github discussions instead From 427b641eb87c84719942c24152e16a7d69f853dc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 6 Jul 2024 18:05:06 +0200 Subject: [PATCH 210/323] chore(update): update repository (#3940) Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action Co-authored-by: folke <292349+folke@users.noreply.github.com> --- .github/PULL_REQUEST_TEMPLATE.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 2a953b1f..c1e6f982 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,15 +1,19 @@ -## What is this PR for? +## Description -## Does this PR fix an existing issue? +## Related Issue(s) +## Screenshots + + + ## Checklist - [ ] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. From 5e1216867b805467f536c9cfec4f9d4c9c0cbae4 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 6 Jul 2024 23:18:20 +0200 Subject: [PATCH 211/323] ci: update --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 51939e69..96993304 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,4 +12,3 @@ jobs: with: plugin: LazyVim repo: LazyVim/LazyVim - tests: true From 21470b49d9f75b09dd762f6f474ba64014338eb2 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 6 Jul 2024 23:19:41 +0200 Subject: [PATCH 212/323] ci: update --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 2b0bb7a8..61ab8286 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ build debug doc/tags foo.* +node_modules tt.* From 40357681959d53f6fbc7b520ecd43f113d51ae09 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 6 Jul 2024 23:45:22 +0200 Subject: [PATCH 213/323] ci: update --- .gitignore | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 61ab8286..771c8351 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,9 @@ *.log -.repro -.tests -build -debug -doc/tags +/.repro +/.tests +/build +/debug +/doc/tags foo.* node_modules tt.* From d108169e951fff8c65ed8dea89b058717cc48da5 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 7 Jul 2024 08:47:57 +0200 Subject: [PATCH 214/323] fix(lualine): check that trouble is installed --- lua/lazyvim/plugins/ui.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index f81296ea..5fde7ebd 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -198,7 +198,7 @@ return { } -- do not add trouble symbols if aerial is enabled - if vim.g.trouble_lualine then + if vim.g.trouble_lualine and LazyVim.has("trouble.nvim") then local trouble = require("trouble") local symbols = trouble.statusline and trouble.statusline({ From 304729b23acebf0c0d00845a4c9fca662e0214d0 Mon Sep 17 00:00:00 2001 From: folke Date: Sun, 7 Jul 2024 06:48:54 +0000 Subject: [PATCH 215/323] chore(build): auto-generate docs --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 239a5792..2b97a37a 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2024 July 06 +*LazyVim.txt* For Neovim Last change: 2024 July 07 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 6202dd164466250b5c188918b34b3e8a3fec2604 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 7 Jul 2024 09:24:59 +0200 Subject: [PATCH 216/323] chore(main): release 12.26.2 (#3946) :robot: I have created a release *beep* *boop* --- ## [12.26.2](https://github.com/LazyVim/LazyVim/compare/v12.26.1...v12.26.2) (2024-07-07) ### Bug Fixes * **lualine:** check that trouble is installed ([d108169](https://github.com/LazyVim/LazyVim/commit/d108169e951fff8c65ed8dea89b058717cc48da5)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/.release-please-manifest.json | 2 +- CHANGELOG.md | 7 +++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index d571892c..ed72d8b7 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "12.26.1" + ".": "12.26.2" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 27ab1b71..5e1d7f4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [12.26.2](https://github.com/LazyVim/LazyVim/compare/v12.26.1...v12.26.2) (2024-07-07) + + +### Bug Fixes + +* **lualine:** check that trouble is installed ([d108169](https://github.com/LazyVim/LazyVim/commit/d108169e951fff8c65ed8dea89b058717cc48da5)) + ## [12.26.1](https://github.com/LazyVim/LazyVim/compare/v12.26.0...v12.26.1) (2024-07-06) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 7be8f511..16ae2fb3 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "12.26.1" -- x-release-please-version +M.version = "12.26.2" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From 33e1da585d8709bcf6c076e80a73b55ef70a9443 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 7 Jul 2024 17:23:53 +0200 Subject: [PATCH 217/323] fix(fzf-lua): move register_select to lazy init --- lua/lazyvim/plugins/extras/editor/fzf.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/extras/editor/fzf.lua b/lua/lazyvim/plugins/extras/editor/fzf.lua index 67acc830..cb2ab95d 100644 --- a/lua/lazyvim/plugins/extras/editor/fzf.lua +++ b/lua/lazyvim/plugins/extras/editor/fzf.lua @@ -190,12 +190,13 @@ return { end, config = function(_, opts) require("fzf-lua").setup(opts) - require("fzf-lua").register_ui_select(opts.ui_select or nil) end, init = function() LazyVim.on_very_lazy(function() vim.ui.select = function(...) - require("fzf-lua") + require("lazy").load({ plugins = { "fzf-lua" } }) + local opts = LazyVim.opts("fzf-lua") or {} + require("fzf-lua").register_ui_select(opts.ui_select or nil) return vim.ui.select(...) end end) From 09831414cfe7009f084536d8c6c74156010302ff Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 7 Jul 2024 17:46:29 +0200 Subject: [PATCH 218/323] test: added tests for mini.icons --- .../extras/{lang_spec.lua => extra_spec.lua} | 24 +++++++++++++++++++ tests/minit.lua | 1 + 2 files changed, 25 insertions(+) rename tests/extras/{lang_spec.lua => extra_spec.lua} (80%) diff --git a/tests/extras/lang_spec.lua b/tests/extras/extra_spec.lua similarity index 80% rename from tests/extras/lang_spec.lua rename to tests/extras/extra_spec.lua index 19eb337d..fa2fc9de 100644 --- a/tests/extras/lang_spec.lua +++ b/tests/extras/extra_spec.lua @@ -1,5 +1,7 @@ ---@module 'luassert' +local Icons = require("mini.icons") + local Plugin = require("lazy.core.plugin") _G.LazyVim = require("lazyvim.util") @@ -98,6 +100,28 @@ describe("Extra", function() ) end) end + + -- Icons + local icons = spec.plugins["mini.icons"] + if icons then + local icon_opts = Plugin.values(icons, "opts", false) or {} + local cats = { "directory", "file", "extension", "filetype", "lsp", "os" } + for _, cat in ipairs(cats) do + local cat_names = Icons.list(cat) + if icon_opts[cat] then + describe("does not set existing icons for " .. cat, function() + for icon_name in pairs(icon_opts[cat]) do + it(icon_name, function() + assert.is_false( + vim.tbl_contains(cat_names, icon_name), + "Icon " .. icon_name .. " already exists:\n" .. vim.inspect({ Icons.get(cat, icon_name) }) + ) + end) + end + end) + end + end + end end) end end) diff --git a/tests/minit.lua b/tests/minit.lua index 6ae23266..88cb4185 100644 --- a/tests/minit.lua +++ b/tests/minit.lua @@ -11,5 +11,6 @@ require("lazy.minit").setup({ "williamboman/mason-lspconfig.nvim", "williamboman/mason.nvim", "nvim-treesitter/nvim-treesitter", + { "echasnovski/mini.icons", opts = {} }, }, }) From aa418a2147f52fbe3225aced3a0e7638cf15ea78 Mon Sep 17 00:00:00 2001 From: Michael Olson <48652773+m0lson84@users.noreply.github.com> Date: Sun, 7 Jul 2024 13:28:51 -0400 Subject: [PATCH 219/323] feat(icons): provide language specific icons in extras (#3931) ## What is this PR for? Provide language specific file icons. The intent is to lay the foundation of this type of extension / configuration. I've added icons for file types that I interact with but this is definitely not holistic. I also went back and forth on whether the configuration should be within the core UI config or in the extras (I landed on the later). Definitely open to feedback on these changes. ## Does this PR fix an existing issue? Nope. ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --------- Co-authored-by: Folke Lemaitre --- lua/lazyvim/plugins/extras/lang/go.lua | 13 ++++++++++++ .../plugins/extras/lang/typescript.lua | 18 +++++++++++++++++ lua/lazyvim/plugins/extras/util/chezmoi.lua | 20 +++++++++++++++++++ lua/lazyvim/plugins/ui.lua | 11 +++++++++- 4 files changed, 61 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/go.lua b/lua/lazyvim/plugins/extras/lang/go.lua index 931f8df4..b9544cfd 100644 --- a/lua/lazyvim/plugins/extras/lang/go.lua +++ b/lua/lazyvim/plugins/extras/lang/go.lua @@ -137,4 +137,17 @@ return { }, }, }, + + -- Filetype icons + { + "echasnovski/mini.icons", + opts = { + file = { + [".go-version"] = { glyph = "", hl = "MiniIconsBlue" }, + }, + filetype = { + gotmpl = { glyph = "󰟓", hl = "MiniIconsGrey" }, + }, + }, + }, } diff --git a/lua/lazyvim/plugins/extras/lang/typescript.lua b/lua/lazyvim/plugins/extras/lang/typescript.lua index 139c3086..71ec4604 100644 --- a/lua/lazyvim/plugins/extras/lang/typescript.lua +++ b/lua/lazyvim/plugins/extras/lang/typescript.lua @@ -248,4 +248,22 @@ return { end end, }, + + -- Filetype icons + { + "echasnovski/mini.icons", + opts = { + file = { + [".eslintrc.js"] = { glyph = "󰱺", hl = "MiniIconsYellow" }, + [".node-version"] = { glyph = "", hl = "MiniIconsGreen" }, + [".prettierrc"] = { glyph = "", hl = "MiniIconsPurple" }, + [".yarnrc.yml"] = { glyph = "", hl = "MiniIconsBlue" }, + ["eslint.config.js"] = { glyph = "󰱺", hl = "MiniIconsYellow" }, + ["package.json"] = { glyph = "", hl = "MiniIconsGreen" }, + ["tsconfig.json"] = { glyph = "", hl = "MiniIconsAzure" }, + ["tsconfig.build.json"] = { glyph = "", hl = "MiniIconsAzure" }, + ["yarn.lock"] = { glyph = "", hl = "MiniIconsBlue" }, + }, + }, + }, } diff --git a/lua/lazyvim/plugins/extras/util/chezmoi.lua b/lua/lazyvim/plugins/extras/util/chezmoi.lua index 56518dfd..633f3008 100644 --- a/lua/lazyvim/plugins/extras/util/chezmoi.lua +++ b/lua/lazyvim/plugins/extras/util/chezmoi.lua @@ -88,4 +88,24 @@ return { table.insert(opts.config.center, 5, projects) end, }, + + -- Filetype icons + { + "echasnovski/mini.icons", + opts = { + file = { + [".chezmoiignore"] = { glyph = "", hl = "MiniIconsGrey" }, + [".chezmoiremove"] = { glyph = "", hl = "MiniIconsGrey" }, + [".chezmoiroot"] = { glyph = "", hl = "MiniIconsGrey" }, + [".chezmoiversion"] = { glyph = "", hl = "MiniIconsGrey" }, + ["bash.tmpl"] = { glyph = "", hl = "MiniIconsGrey" }, + ["json.tmpl"] = { glyph = "", hl = "MiniIconsGrey" }, + ["ps1.tmpl"] = { glyph = "󰨊", hl = "MiniIconsGrey" }, + ["sh.tmpl"] = { glyph = "", hl = "MiniIconsGrey" }, + ["toml.tmpl"] = { glyph = "", hl = "MiniIconsGrey" }, + ["yaml.tmpl"] = { glyph = "", hl = "MiniIconsGrey" }, + ["zsh.tmpl"] = { glyph = "", hl = "MiniIconsGrey" }, + }, + }, + }, } diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index 5fde7ebd..97c35ae9 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -306,7 +306,16 @@ return { { "echasnovski/mini.icons", lazy = true, - opts = {}, + opts = { + file = { + [".keep"] = { glyph = "󰊢", hl = "MiniIconsGrey" }, + ["CODEOWNERS"] = { glyph = "", hl = "MiniIconsGreen" }, + ["devcontainer.json"] = { glyph = "", hl = "MiniIconsAzure" }, + }, + filetype = { + dotenv = { glyph = "", hl = "MiniIconsYellow" }, + }, + }, init = function() package.preload["nvim-web-devicons"] = function() require("mini.icons").mock_nvim_web_devicons() From f3c93701e72fcd18322404c062c384f824b9ca6f Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 7 Jul 2024 20:41:37 +0200 Subject: [PATCH 220/323] style(icons): CODEOWNERS has a default icon --- lua/lazyvim/plugins/ui.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index 97c35ae9..14a77ce4 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -309,7 +309,6 @@ return { opts = { file = { [".keep"] = { glyph = "󰊢", hl = "MiniIconsGrey" }, - ["CODEOWNERS"] = { glyph = "", hl = "MiniIconsGreen" }, ["devcontainer.json"] = { glyph = "", hl = "MiniIconsAzure" }, }, filetype = { From 8b2eacb6ac2a8df3c9eaba69fbce34abc3666ec1 Mon Sep 17 00:00:00 2001 From: kezhenxu94 Date: Mon, 8 Jul 2024 02:50:13 +0800 Subject: [PATCH 221/323] feat(java): allow overriding test config (#3891) ## What is this PR for? Allow overriding java test config ## Does this PR fix an existing issue? NO ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/lang/java.lua | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/java.lua b/lua/lazyvim/plugins/extras/lang/java.lua index 7a47c905..7d667338 100644 --- a/lua/lazyvim/plugins/extras/lang/java.lua +++ b/lua/lazyvim/plugins/extras/lang/java.lua @@ -225,8 +225,18 @@ return { -- custom keymaps for Java test runner (not yet compatible with neotest) wk.register({ ["t"] = { name = "+test" }, - ["tt"] = { require("jdtls.dap").test_class, "Run All Test" }, - ["tr"] = { require("jdtls.dap").test_nearest_method, "Run Nearest Test" }, + ["tt"] = { + function() + require("jdtls.dap").test_class({ config_overrides = opts.test.config_overrides }) + end, + "Run All Test", + }, + ["tr"] = { + function() + require("jdtls.dap").test_nearest_method({ config_overrides = opts.test.config_overrides }) + end, + "Run Nearest Test", + }, ["tT"] = { require("jdtls.dap").pick_test, "Run Test" }, }, { mode = "n", buffer = args.buf }) end From 28805d1a4c09b8dccbac8db4f7c6576a29abbd40 Mon Sep 17 00:00:00 2001 From: med8bra Date: Sun, 7 Jul 2024 20:25:45 +0100 Subject: [PATCH 222/323] fix(lazygit): improve git browse (#3941) ## Description Improves git browse command by handling different types of remotes, and allows user to extend to other git hosts. ## Related Issue(s) Fixes #3886 ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --------- Co-authored-by: Folke Lemaitre --- lua/lazyvim/util/lazygit.lua | 36 ++++++++++++++++++++++++++----- tests/util/lazygit_spec.lua | 42 ++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+), 5 deletions(-) create mode 100644 tests/util/lazygit_spec.lua diff --git a/lua/lazyvim/util/lazygit.lua b/lua/lazyvim/util/lazygit.lua index 2e030cb6..2532ad08 100644 --- a/lua/lazyvim/util/lazygit.lua +++ b/lua/lazyvim/util/lazygit.lua @@ -159,17 +159,43 @@ function M.blame_line(opts) return require("lazy.util").float_cmd(cmd, opts) end +-- stylua: ignore +M.remote_patterns = { + { "^(https?://.*)%.git$" , "%1" }, + { "^git@(.+):(.+)%.git$" , "https://%1/%2" }, + { "^git@(.+):(.+)$" , "https://%1/%2" }, + { "^git@(.+)/(.+)$" , "https://%1/%2" }, + { "^ssh://git@(.*)$" , "https://%1" }, + { "ssh%.dev%.azure%.com/v3/(.*)/(.*)$", "dev.azure.com/%1/_git/%2" }, + { "^https://%w*@(.*)" , "https://%1" }, + { "^git@(.*)" , "https://%1" }, + { ":%d+" , "" }, + { "%.git$" , "" }, +} + +---@param remote string +function M.get_url(remote) + local ret = remote + for _, pattern in ipairs(M.remote_patterns) do + ret = ret:gsub(pattern[1], pattern[2]) + end + return ret:find("https://") == 1 and ret or ("https://%s"):format(ret) +end + function M.browse() local lines = require("lazy.manage.process").exec({ "git", "remote", "-v" }) local remotes = {} ---@type {name:string, url:string}[] for _, line in ipairs(lines) do - local name, url = line:match("(%S+)%s+(%S+)%s+%(fetch%)") - if name and url then - if url:find("git@") == 1 then - url = url:gsub("git@(%S+):", "https://%1/"):gsub(".git$", "") + local name, remote = line:match("(%S+)%s+(%S+)%s+%(fetch%)") + if name and remote then + local url = M.get_url(remote) + if url then + table.insert(remotes, { + name = name, + url = url, + }) end - table.insert(remotes, { name = name, url = url }) end end diff --git a/tests/util/lazygit_spec.lua b/tests/util/lazygit_spec.lua new file mode 100644 index 00000000..518e886a --- /dev/null +++ b/tests/util/lazygit_spec.lua @@ -0,0 +1,42 @@ +---@module "luassert" + +_G.LazyVim = require("lazyvim.util") + +-- stylua: ignore +local git_remotes_cases = { + ["https://github.com/LazyVim/LazyVim.git"] = "https://github.com/LazyVim/LazyVim", + ["https://github.com/LazyVim/LazyVim"] = "https://github.com/LazyVim/LazyVim", + ["git@github.com:LazyVim/LazyVim"] = "https://github.com/LazyVim/LazyVim", + ["git@ssh.dev.azure.com:v3/neovim-org/owner/repo"] = "https://dev.azure.com/neovim-org/owner/_git/repo", + ["https://folkelemaitre@bitbucket.org/samiulazim/neovim.git"] = "https://bitbucket.org/samiulazim/neovim", + ["git@bitbucket.org:samiulazim/neovim.git"] = "https://bitbucket.org/samiulazim/neovim", + ["git@gitlab.com:inkscape/inkscape.git"] = "https://gitlab.com/inkscape/inkscape", + ["https://gitlab.com/inkscape/inkscape.git"] = "https://gitlab.com/inkscape/inkscape", + ["git@github.com:torvalds/linux.git"] = "https://github.com/torvalds/linux", + ["https://github.com/torvalds/linux.git"] = "https://github.com/torvalds/linux", + ["git@bitbucket.org:team/repo.git"] = "https://bitbucket.org/team/repo", + ["https://bitbucket.org/team/repo.git"] = "https://bitbucket.org/team/repo", + ["git@gitlab.com:example-group/example-project.git"] = "https://gitlab.com/example-group/example-project", + ["https://gitlab.com/example-group/example-project.git"] = "https://gitlab.com/example-group/example-project", + ["git@ssh.dev.azure.com:v3/org/project/repo"] = "https://dev.azure.com/org/project/_git/repo", + ["https://username@dev.azure.com/org/project/_git/repo"] = "https://dev.azure.com/org/project/_git/repo", + ["ssh://git@ghe.example.com:2222/org/repo.git"] = "https://ghe.example.com/org/repo", + ["https://ghe.example.com/org/repo.git"] = "https://ghe.example.com/org/repo", + ["git-codecommit.us-east-1.amazonaws.com/v1/repos/MyDemoRepo"] = "https://git-codecommit.us-east-1.amazonaws.com/v1/repos/MyDemoRepo", + ["https://git-codecommit.us-east-1.amazonaws.com/v1/repos/MyDemoRepo"] = "https://git-codecommit.us-east-1.amazonaws.com/v1/repos/MyDemoRepo", + ["ssh://git@source.developers.google.com:2022/p/project/r/repo"] = "https://source.developers.google.com/p/project/r/repo", + ["https://source.developers.google.com/p/project/r/repo"] = "https://source.developers.google.com/p/project/r/repo", + ["git@git.sr.ht:~user/repo"] = "https://git.sr.ht/~user/repo", + ["https://git.sr.ht/~user/repo"] = "https://git.sr.ht/~user/repo", + ["git@git.sr.ht:~user/another-repo"] = "https://git.sr.ht/~user/another-repo", + ["https://git.sr.ht/~user/another-repo"] = "https://git.sr.ht/~user/another-repo", +} + +describe("util.lazygit", function() + for remote, expected in pairs(git_remotes_cases) do + it("should parse git remote " .. remote, function() + local url = LazyVim.lazygit.get_url(remote) + assert.are.equal(expected, url) + end) + end +end) From bf9887adacc4b37991aefc2b4514d07a6debb3b4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 7 Jul 2024 21:28:01 +0200 Subject: [PATCH 223/323] chore(main): release 12.27.0 (#3949) :robot: I have created a release *beep* *boop* --- ## [12.27.0](https://github.com/LazyVim/LazyVim/compare/v12.26.2...v12.27.0) (2024-07-07) ### Features * **icons:** provide language specific icons in extras ([#3931](https://github.com/LazyVim/LazyVim/issues/3931)) ([aa418a2](https://github.com/LazyVim/LazyVim/commit/aa418a2147f52fbe3225aced3a0e7638cf15ea78)) * **java:** allow overriding test config ([#3891](https://github.com/LazyVim/LazyVim/issues/3891)) ([8b2eacb](https://github.com/LazyVim/LazyVim/commit/8b2eacb6ac2a8df3c9eaba69fbce34abc3666ec1)) ### Bug Fixes * **fzf-lua:** move register_select to lazy init ([33e1da5](https://github.com/LazyVim/LazyVim/commit/33e1da585d8709bcf6c076e80a73b55ef70a9443)) * **lazygit:** improve git browse ([#3941](https://github.com/LazyVim/LazyVim/issues/3941)) ([28805d1](https://github.com/LazyVim/LazyVim/commit/28805d1a4c09b8dccbac8db4f7c6576a29abbd40)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/.release-please-manifest.json | 2 +- CHANGELOG.md | 14 ++++++++++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index ed72d8b7..305f28c3 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "12.26.2" + ".": "12.27.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e1d7f4d..01025e4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [12.27.0](https://github.com/LazyVim/LazyVim/compare/v12.26.2...v12.27.0) (2024-07-07) + + +### Features + +* **icons:** provide language specific icons in extras ([#3931](https://github.com/LazyVim/LazyVim/issues/3931)) ([aa418a2](https://github.com/LazyVim/LazyVim/commit/aa418a2147f52fbe3225aced3a0e7638cf15ea78)) +* **java:** allow overriding test config ([#3891](https://github.com/LazyVim/LazyVim/issues/3891)) ([8b2eacb](https://github.com/LazyVim/LazyVim/commit/8b2eacb6ac2a8df3c9eaba69fbce34abc3666ec1)) + + +### Bug Fixes + +* **fzf-lua:** move register_select to lazy init ([33e1da5](https://github.com/LazyVim/LazyVim/commit/33e1da585d8709bcf6c076e80a73b55ef70a9443)) +* **lazygit:** improve git browse ([#3941](https://github.com/LazyVim/LazyVim/issues/3941)) ([28805d1](https://github.com/LazyVim/LazyVim/commit/28805d1a4c09b8dccbac8db4f7c6576a29abbd40)) + ## [12.26.2](https://github.com/LazyVim/LazyVim/compare/v12.26.1...v12.26.2) (2024-07-07) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 16ae2fb3..74049b58 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "12.26.2" -- x-release-please-version +M.version = "12.27.0" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From 67650528e47a57fb687bce2d7bb61fb4f1af8f63 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 8 Jul 2024 07:52:18 +0200 Subject: [PATCH 224/323] fix(vscode): allow overriding default vscode keymaps. Fixes #3950 --- lua/lazyvim/config/init.lua | 3 ++- lua/lazyvim/plugins/extras/vscode.lua | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 74049b58..0c8bb1a4 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -248,16 +248,17 @@ function M.load(name) end, { msg = "Failed loading " .. mod }) end end + local pattern = "LazyVim" .. name:sub(1, 1):upper() .. name:sub(2) -- always load lazyvim, then user file if M.defaults[name] or name == "options" then _load("lazyvim.config." .. name) + vim.api.nvim_exec_autocmds("User", { pattern = pattern .. "Defaults", modeline = false }) end _load("config." .. name) if vim.bo.filetype == "lazy" then -- HACK: LazyVim may have overwritten options of the Lazy ui, so reset this here vim.cmd([[do VimResized]]) end - local pattern = "LazyVim" .. name:sub(1, 1):upper() .. name:sub(2) vim.api.nvim_exec_autocmds("User", { pattern = pattern, modeline = false }) end diff --git a/lua/lazyvim/plugins/extras/vscode.lua b/lua/lazyvim/plugins/extras/vscode.lua index 25930d1d..98a22205 100644 --- a/lua/lazyvim/plugins/extras/vscode.lua +++ b/lua/lazyvim/plugins/extras/vscode.lua @@ -30,7 +30,7 @@ end -- Add some vscode specific keymaps vim.api.nvim_create_autocmd("User", { - pattern = "LazyVimKeymaps", + pattern = "LazyVimKeymapsDefaults", callback = function() vim.keymap.set("n", "", "Find") vim.keymap.set("n", "/", [[call VSCodeNotify('workbench.action.findInFiles')]]) From 8a340511774b93c6dd75368960ebbb44aa58df5c Mon Sep 17 00:00:00 2001 From: folke Date: Mon, 8 Jul 2024 05:53:15 +0000 Subject: [PATCH 225/323] chore(build): auto-generate docs --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 2b97a37a..e29b9906 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2024 July 07 +*LazyVim.txt* For Neovim Last change: 2024 July 08 ============================================================================== Table of Contents *LazyVim-table-of-contents* From b481b644ddf9f02470ec50264e63c6dd69d444f8 Mon Sep 17 00:00:00 2001 From: sus-domesticus <134197728+sus-domesticus@users.noreply.github.com> Date: Tue, 9 Jul 2024 18:12:02 +0300 Subject: [PATCH 226/323] fix(java): fix `config_overrides` for tests (#3968) ## Description Problem In the default configuration `opts.test` is a boolean and the code tries to access `opts.test.config_overrides` which results in an error. Solution Use control flow to return nil in the case of `opts.test` being boolean. ## Related Issue(s) - Fixes #3965. ## Checklist - [ x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/lang/java.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/java.lua b/lua/lazyvim/plugins/extras/lang/java.lua index 7d667338..f03e2ab7 100644 --- a/lua/lazyvim/plugins/extras/lang/java.lua +++ b/lua/lazyvim/plugins/extras/lang/java.lua @@ -227,13 +227,17 @@ return { ["t"] = { name = "+test" }, ["tt"] = { function() - require("jdtls.dap").test_class({ config_overrides = opts.test.config_overrides }) + require("jdtls.dap").test_class({ + config_overrides = type(opts.test) ~= "boolean" and opts.test.config_overrides or nil, + }) end, "Run All Test", }, ["tr"] = { function() - require("jdtls.dap").test_nearest_method({ config_overrides = opts.test.config_overrides }) + require("jdtls.dap").test_nearest_method({ + config_overrides = type(opts.test) ~= "boolean" and opts.test.config_overrides or nil, + }) end, "Run Nearest Test", }, From d6bda2469787c566801fc0d00e6146c645cbb09f Mon Sep 17 00:00:00 2001 From: folke Date: Tue, 9 Jul 2024 15:13:00 +0000 Subject: [PATCH 227/323] chore(build): auto-generate docs --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index e29b9906..0ecd01f3 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2024 July 08 +*LazyVim.txt* For Neovim Last change: 2024 July 09 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 927031a2de93f694b032a4df5e6d93fff635a496 Mon Sep 17 00:00:00 2001 From: Mike Pilmer Date: Wed, 10 Jul 2024 00:11:26 -0700 Subject: [PATCH 228/323] fix(autocmds): fixed pattern for autocommand to autoenable wrap and spell in text files (#3975) ## Description Autocommand group lazyvim_wrap_spell was not triggering for all of the specified file types. The autocommand will now trigger for types "text", "plaintex", "typst", "gitcommit", "markdown" as intended. ## Related Issue(s) - Fixes #3973 ## Checklist - [X] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/config/autocmds.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/config/autocmds.lua b/lua/lazyvim/config/autocmds.lua index 58f43f0b..f9a83c82 100644 --- a/lua/lazyvim/config/autocmds.lua +++ b/lua/lazyvim/config/autocmds.lua @@ -87,7 +87,7 @@ vim.api.nvim_create_autocmd("FileType", { -- wrap and check for spell in text filetypes vim.api.nvim_create_autocmd("FileType", { group = augroup("wrap_spell"), - pattern = { "*.txt", "*.tex", "*.typ", "gitcommit", "markdown" }, + pattern = { "text", "plaintex", "typst", "gitcommit", "markdown" }, callback = function() vim.opt_local.wrap = true vim.opt_local.spell = true From 11268d8ff1c3675dd4afe45dfd0348cd36a98731 Mon Sep 17 00:00:00 2001 From: folke Date: Wed, 10 Jul 2024 07:12:24 +0000 Subject: [PATCH 229/323] chore(build): auto-generate docs --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 0ecd01f3..27a4a399 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2024 July 09 +*LazyVim.txt* For Neovim Last change: 2024 July 10 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 8bfd9a50a71d8b8147f7d742e8d0f05ee6cba888 Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Thu, 11 Jul 2024 18:40:17 +0300 Subject: [PATCH 230/323] fix(php): `php_cs_fixer` is the correct name (#3991) ## Description `conform.nvim` was not using the correct formatter name for `php-cs-fixer` (which is the name of the binary). Also move `conform.nvim` spec outside of `nvim-lint` spec. ## Related Issue(s) Fixes #3985 ## Screenshots ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/lang/php.lua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/php.lua b/lua/lazyvim/plugins/extras/lang/php.lua index e0809729..70814eae 100644 --- a/lua/lazyvim/plugins/extras/lang/php.lua +++ b/lua/lazyvim/plugins/extras/lang/php.lua @@ -74,13 +74,13 @@ return { php = { "phpcs" }, }, }, - { - "stevearc/conform.nvim", - optional = true, - opts = { - formatters_by_ft = { - php = { "php-cs-fixer" }, - }, + }, + { + "stevearc/conform.nvim", + optional = true, + opts = { + formatters_by_ft = { + php = { "php_cs_fixer" }, }, }, }, From 0e2eaa3fbad1519e9f4fb29235e13374f297ff00 Mon Sep 17 00:00:00 2001 From: folke Date: Thu, 11 Jul 2024 15:41:05 +0000 Subject: [PATCH 231/323] chore(build): auto-generate docs --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 27a4a399..cfd97be7 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2024 July 10 +*LazyVim.txt* For Neovim Last change: 2024 July 11 ============================================================================== Table of Contents *LazyVim-table-of-contents* From db234ef9cbbb1b7b0efa8e3af5c446b965e7c07a Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Fri, 12 Jul 2024 23:06:34 +0300 Subject: [PATCH 232/323] fix(outline): use new object for `symbols.filter` (#4006) ## Description In `outline.nvim` we have `symbols.filter = LazyVim.config.kind_filter`. `outline.nvim` adds an entry `exclude = false` by default when it's a table. This entry propagates to `LazyVim.config.kind_filter` and when using `LazyVim.config.get_kind_filter()` in Telescope `ss` that entry is there as well and causes the error in https://github.com/nvim-telescope/telescope.nvim/blob/bfcc7d5c6f12209139f175e6123a7b7de6d9c18a/lua/telescope/utils.lua#L143. Use `vim.deepcopy` to create a new object for `symbols.filter` in `outline.nvim`, so that the additional entries don't propagate to default `LazyVim.config.kind_filter`. ## Related Issue(s) Fixes #4003 ## Screenshots ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/editor/outline.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/editor/outline.lua b/lua/lazyvim/plugins/extras/editor/outline.lua index e9aad2a0..5b5a5831 100644 --- a/lua/lazyvim/plugins/extras/editor/outline.lua +++ b/lua/lazyvim/plugins/extras/editor/outline.lua @@ -16,7 +16,7 @@ return { local opts = { symbols = { icons = {}, - filter = LazyVim.config.kind_filter, + filter = vim.deepcopy(LazyVim.config.kind_filter), }, keymaps = { up_and_jump = "", From 4a6c0c285043d1d5651e01f3e415ccbe51a3fef2 Mon Sep 17 00:00:00 2001 From: folke Date: Fri, 12 Jul 2024 20:07:43 +0000 Subject: [PATCH 233/323] chore(build): auto-generate docs --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index cfd97be7..29dbf876 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2024 July 11 +*LazyVim.txt* For Neovim Last change: 2024 July 12 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 702471e454ff552189ab03325dc19d0f7a601704 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Fri, 12 Jul 2024 22:54:35 +0200 Subject: [PATCH 234/323] feat: new mappings format for which-key v3. Forgot to push :) --- lua/lazyvim/plugins/editor.lua | 55 +++++++----- .../plugins/extras/editor/overseer.lua | 4 +- lua/lazyvim/plugins/extras/lang/markdown.lua | 1 + lua/lazyvim/plugins/extras/lang/r.lua | 29 +++---- lua/lazyvim/util/mini.lua | 85 +++++++++---------- 5 files changed, 94 insertions(+), 80 deletions(-) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index fa5d676e..5bdbcb12 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -162,32 +162,47 @@ return { { "folke/which-key.nvim", event = "VeryLazy", + opts_extend = { "spec" }, opts = { - plugins = { spelling = true }, - defaults = { - mode = { "n", "v" }, - ["g"] = { name = "+goto" }, - ["gs"] = { name = "+surround" }, - ["z"] = { name = "+fold" }, - ["]"] = { name = "+next" }, - ["["] = { name = "+prev" }, - [""] = { name = "+tabs" }, - ["b"] = { name = "+buffer" }, - ["c"] = { name = "+code" }, - ["f"] = { name = "+file/find" }, - ["g"] = { name = "+git" }, - ["gh"] = { name = "+hunks", ["_"] = "which_key_ignore" }, - ["q"] = { name = "+quit/session" }, - ["s"] = { name = "+search" }, - ["u"] = { name = "+ui" }, - ["w"] = { name = "+windows" }, - ["x"] = { name = "+diagnostics/quickfix" }, + defaults = {}, + spec = { + { + mode = { "n", "v" }, + { "", group = "tabs" }, + { "b", group = "buffer" }, + { "c", group = "code" }, + { "f", group = "file/find" }, + { "g", group = "git" }, + { "gh", group = "hunks" }, + { "q", group = "quit/session" }, + { "s", group = "search" }, + { "u", group = "ui" }, + { "w", group = "windows" }, + { "x", group = "diagnostics/quickfix" }, + { "[", group = "prev" }, + { "]", group = "next" }, + { "g", group = "goto" }, + { "gs", group = "surround" }, + { "z", group = "fold" }, + }, + }, + }, + keys = { + { + "?", + function() + require("which-key").show({ global = false }) + end, + desc = "Buffer Local Keymaps (which-key)", }, }, config = function(_, opts) local wk = require("which-key") wk.setup(opts) - wk.register(opts.defaults) + if not vim.tbl_isempty(opts.defaults) then + LazyVim.warn("which-key: opts.defaults is deprecated. Please use opts.spec instead.") + wk.register(opts.defaults) + end end, }, diff --git a/lua/lazyvim/plugins/extras/editor/overseer.lua b/lua/lazyvim/plugins/extras/editor/overseer.lua index 0ef281ae..373c0029 100644 --- a/lua/lazyvim/plugins/extras/editor/overseer.lua +++ b/lua/lazyvim/plugins/extras/editor/overseer.lua @@ -64,7 +64,9 @@ return { "folke/which-key.nvim", optional = true, opts = { - defaults = { ["o"] = { name = "+overseer" } }, + spec = { + { "o", group = "overseer" }, + }, }, }, { diff --git a/lua/lazyvim/plugins/extras/lang/markdown.lua b/lua/lazyvim/plugins/extras/lang/markdown.lua index c8424ea5..7d026b23 100644 --- a/lua/lazyvim/plugins/extras/lang/markdown.lua +++ b/lua/lazyvim/plugins/extras/lang/markdown.lua @@ -100,6 +100,7 @@ return { headline_highlights = {}, -- disable bullets for now. See https://github.com/lukas-reineke/headlines.nvim/issues/66 bullets = {}, + quote_string = false, } for i = 1, 6 do local hl = "Headline" .. i diff --git a/lua/lazyvim/plugins/extras/lang/r.lua b/lua/lazyvim/plugins/extras/lang/r.lua index e3dd3302..96e618b3 100644 --- a/lua/lazyvim/plugins/extras/lang/r.lua +++ b/lua/lazyvim/plugins/extras/lang/r.lua @@ -21,22 +21,19 @@ return { -- Increase the width of which-key to handle the longer r-nvim descriptions local wk = require("which-key") - -- Workaround from https://github.com/folke/which-key.nvim/issues/514#issuecomment-1987286901 - wk.register({ - [""] = { - a = { name = "+(a)ll", ["🚫"] = "which_key_ignore" }, - b = { name = "+(b)etween marks", ["🚫"] = "which_key_ignore" }, - c = { name = "+(c)hunks", ["🚫"] = "which_key_ignore" }, - f = { name = "+(f)unctions", ["🚫"] = "which_key_ignore" }, - g = { name = "+(g)oto", ["🚫"] = "which_key_ignore" }, - k = { name = "+(k)nit", ["🚫"] = "which_key_ignore" }, - p = { name = "+(p)aragraph", ["🚫"] = "which_key_ignore" }, - q = { name = "+(q)uarto", ["🚫"] = "which_key_ignore" }, - r = { name = "+(r) general", ["🚫"] = "which_key_ignore" }, - s = { name = "+(s)plit or (s)end", ["🚫"] = "which_key_ignore" }, - t = { name = "+(t)erminal", ["🚫"] = "which_key_ignore" }, - v = { name = "+(v)iew", ["🚫"] = "which_key_ignore" }, - }, + wk.add({ + { "a", group = "all" }, + { "b", group = "between marks" }, + { "c", group = "chunks" }, + { "f", group = "functions" }, + { "g", group = "goto" }, + { "k", group = "knit" }, + { "p", group = "paragraph" }, + { "q", group = "quarto" }, + { "r", group = "r general" }, + { "s", group = "split or send" }, + { "t", group = "terminal" }, + { "v", group = "view" }, }) end, }, diff --git a/lua/lazyvim/util/mini.lua b/lua/lazyvim/util/mini.lua index a0fe407b..a35999c4 100644 --- a/lua/lazyvim/util/mini.lua +++ b/lua/lazyvim/util/mini.lua @@ -61,52 +61,51 @@ end -- register all text objects with which-key function M.ai_whichkey() - ---@type table - local i = { - [" "] = "Whitespace", - ['"'] = 'Balanced "', - ["'"] = "Balanced '", - ["`"] = "Balanced `", - ["("] = "Balanced (", - [")"] = "Balanced ) including white-space", - [">"] = "Balanced > including white-space", - [""] = "Balanced <", - ["]"] = "Balanced ] including white-space", - ["["] = "Balanced [", - ["}"] = "Balanced } including white-space", - ["{"] = "Balanced {", - ["?"] = "User Prompt", - _ = "Underscore", - a = "Argument", - b = "Balanced ), ], }", - c = "Class", - d = "Digit(s)", - e = "Word in CamelCase & snake_case", - f = "Function", - g = "Entire file", - i = "Indent", - o = "Block, conditional, loop", - q = "Quote `, \", '", - t = "Tag", - u = "Use/call function & method", - U = "Use/call without dot in name", + local objects = { + { " ", desc = "whitespace" }, + { '"', desc = 'balanced "' }, + { "'", desc = "balanced '" }, + { "(", desc = "balanced (" }, + { ")", desc = "balanced ) including white-space" }, + { "<", desc = "balanced <" }, + { ">", desc = "balanced > including white-space" }, + { "?", desc = "user prompt" }, + { "U", desc = "use/call without dot in name" }, + { "[", desc = "balanced [" }, + { "]", desc = "balanced ] including white-space" }, + { "_", desc = "underscore" }, + { "`", desc = "balanced `" }, + { "a", desc = "argument" }, + { "b", desc = "balanced )]}" }, + { "c", desc = "class" }, + { "d", desc = "digit(s)" }, + { "e", desc = "word in CamelCase & snake_case" }, + { "f", desc = "function" }, + { "g", desc = "entire file" }, + { "i", desc = "indent" }, + { "o", desc = "block, conditional, loop" }, + { "q", desc = "quote `\"'" }, + { "t", desc = "tag" }, + { "u", desc = "use/call function & method" }, + { "{", desc = "balanced {" }, + { "}", desc = "balanced } including white-space" }, } - local a = vim.deepcopy(i) - for k, v in pairs(a) do - a[k] = v:gsub(" including.*", "") - end - local ic = vim.deepcopy(i) - local ac = vim.deepcopy(a) - for key, name in pairs({ n = "Next", l = "Last" }) do - i[key] = vim.tbl_extend("force", { name = "Inside " .. name .. " textobject" }, ic) - a[key] = vim.tbl_extend("force", { name = "Around " .. name .. " textobject" }, ac) + local ret = { mode = { "o", "x" } } + for prefix, name in pairs({ + i = "inside", + a = "around", + il = "last", + ["in"] = "next", + al = "last", + an = "next", + }) do + ret[#ret + 1] = { prefix, group = name } + for _, obj in ipairs(objects) do + ret[#ret + 1] = { prefix .. obj[1], desc = obj.desc } + end end - require("which-key").register({ - mode = { "o", "x" }, - i = i, - a = a, - }) + require("which-key").add(ret, { notify = false }) end ---@param opts {skip_next: string, skip_ts: string[], skip_unbalanced: boolean, markdown: boolean} From 9391ff9fa34e8c66aaeb0c7ebf9cb47e68e621a6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 12 Jul 2024 22:56:08 +0200 Subject: [PATCH 235/323] chore(main): release 12.28.0 (#3952) :robot: I have created a release *beep* *boop* --- ## [12.28.0](https://github.com/LazyVim/LazyVim/compare/v12.27.0...v12.28.0) (2024-07-12) ### Features * new mappings format for which-key v3. Forgot to push :) ([702471e](https://github.com/LazyVim/LazyVim/commit/702471e454ff552189ab03325dc19d0f7a601704)) ### Bug Fixes * **autocmds:** fixed pattern for autocommand to autoenable wrap and spell in text files ([#3975](https://github.com/LazyVim/LazyVim/issues/3975)) ([927031a](https://github.com/LazyVim/LazyVim/commit/927031a2de93f694b032a4df5e6d93fff635a496)) * **java:** fix `config_overrides` for tests ([#3968](https://github.com/LazyVim/LazyVim/issues/3968)) ([b481b64](https://github.com/LazyVim/LazyVim/commit/b481b644ddf9f02470ec50264e63c6dd69d444f8)) * **outline:** use new object for `symbols.filter` ([#4006](https://github.com/LazyVim/LazyVim/issues/4006)) ([db234ef](https://github.com/LazyVim/LazyVim/commit/db234ef9cbbb1b7b0efa8e3af5c446b965e7c07a)) * **php:** `php_cs_fixer` is the correct name ([#3991](https://github.com/LazyVim/LazyVim/issues/3991)) ([8bfd9a5](https://github.com/LazyVim/LazyVim/commit/8bfd9a50a71d8b8147f7d742e8d0f05ee6cba888)) * **vscode:** allow overriding default vscode keymaps. Fixes [#3950](https://github.com/LazyVim/LazyVim/issues/3950) ([6765052](https://github.com/LazyVim/LazyVim/commit/67650528e47a57fb687bce2d7bb61fb4f1af8f63)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/.release-please-manifest.json | 2 +- CHANGELOG.md | 16 ++++++++++++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index 305f28c3..baee08c0 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "12.27.0" + ".": "12.28.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 01025e4f..2f4832e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## [12.28.0](https://github.com/LazyVim/LazyVim/compare/v12.27.0...v12.28.0) (2024-07-12) + + +### Features + +* new mappings format for which-key v3. Forgot to push :) ([702471e](https://github.com/LazyVim/LazyVim/commit/702471e454ff552189ab03325dc19d0f7a601704)) + + +### Bug Fixes + +* **autocmds:** fixed pattern for autocommand to autoenable wrap and spell in text files ([#3975](https://github.com/LazyVim/LazyVim/issues/3975)) ([927031a](https://github.com/LazyVim/LazyVim/commit/927031a2de93f694b032a4df5e6d93fff635a496)) +* **java:** fix `config_overrides` for tests ([#3968](https://github.com/LazyVim/LazyVim/issues/3968)) ([b481b64](https://github.com/LazyVim/LazyVim/commit/b481b644ddf9f02470ec50264e63c6dd69d444f8)) +* **outline:** use new object for `symbols.filter` ([#4006](https://github.com/LazyVim/LazyVim/issues/4006)) ([db234ef](https://github.com/LazyVim/LazyVim/commit/db234ef9cbbb1b7b0efa8e3af5c446b965e7c07a)) +* **php:** `php_cs_fixer` is the correct name ([#3991](https://github.com/LazyVim/LazyVim/issues/3991)) ([8bfd9a5](https://github.com/LazyVim/LazyVim/commit/8bfd9a50a71d8b8147f7d742e8d0f05ee6cba888)) +* **vscode:** allow overriding default vscode keymaps. Fixes [#3950](https://github.com/LazyVim/LazyVim/issues/3950) ([6765052](https://github.com/LazyVim/LazyVim/commit/67650528e47a57fb687bce2d7bb61fb4f1af8f63)) + ## [12.27.0](https://github.com/LazyVim/LazyVim/compare/v12.26.2...v12.27.0) (2024-07-07) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 0c8bb1a4..be1cc91d 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "12.27.0" -- x-release-please-version +M.version = "12.28.0" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From ca37162cb7452dce32cf3f0ad661bcd1245286c0 Mon Sep 17 00:00:00 2001 From: Bao <6306455+baodrate@users.noreply.github.com> Date: Sat, 13 Jul 2024 02:51:19 -0500 Subject: [PATCH 236/323] fix(flit): use which-key preset keymap descriptions (#4000) ## Description The flit config overrides the descriptions provided by the which-key presets plugin for the `f`/`F`/`t`/`T` motions with an unhelpful description text (just the key itself). Remove the `desc` argument so that which-key uses the existing description (e.g "Move before next char"). ## Related Issue(s) ## Screenshots | Before | After | | ------------- | ------------- | | ![Before](https://github.com/user-attachments/assets/39b885fe-95c2-4a6e-8b22-4e5ddf1986a9) | ![After](https://github.com/user-attachments/assets/6042fde3-e135-48fa-b1fd-c6047277903a) | ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/editor/leap.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/extras/editor/leap.lua b/lua/lazyvim/plugins/extras/editor/leap.lua index cf6e7478..19c8b331 100644 --- a/lua/lazyvim/plugins/extras/editor/leap.lua +++ b/lua/lazyvim/plugins/extras/editor/leap.lua @@ -7,10 +7,10 @@ return { "ggandor/flit.nvim", enabled = true, keys = function() - ---@type LazyKeys[] + ---@type LazyKeysSpec[] local ret = {} for _, key in ipairs({ "f", "F", "t", "T" }) do - ret[#ret + 1] = { key, mode = { "n", "x", "o" }, desc = key } + ret[#ret + 1] = { key, mode = { "n", "x", "o" } } end return ret end, From 406aa9d8b4e6c997ef32b89df8c75373b1233ff9 Mon Sep 17 00:00:00 2001 From: folke Date: Sat, 13 Jul 2024 07:52:17 +0000 Subject: [PATCH 237/323] chore(build): auto-generate docs --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 29dbf876..cb32929e 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2024 July 12 +*LazyVim.txt* For Neovim Last change: 2024 July 13 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 28a7f8126c1b46b41ca58845ee081b67ce6981f2 Mon Sep 17 00:00:00 2001 From: Lawrence Ho <203431+lawrenceho@users.noreply.github.com> Date: Sat, 13 Jul 2024 15:54:58 +0800 Subject: [PATCH 238/323] feat(java): new java mappings format for which-key v3 (#4013) ## Description Use which-key v3 format for java mappings. `c` is removed as it is reported as a duplicate mapping in health check. ## Related Issue(s) ## Screenshots ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/lang/java.lua | 98 ++++++++++++++---------- 1 file changed, 57 insertions(+), 41 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/java.lua b/lua/lazyvim/plugins/extras/lang/java.lua index f03e2ab7..97e37ef5 100644 --- a/lua/lazyvim/plugins/extras/lang/java.lua +++ b/lua/lazyvim/plugins/extras/lang/java.lua @@ -190,30 +190,40 @@ return { local client = vim.lsp.get_client_by_id(args.data.client_id) if client and client.name == "jdtls" then local wk = require("which-key") - wk.register({ - ["cx"] = { name = "+extract" }, - ["cxv"] = { require("jdtls").extract_variable_all, "Extract Variable" }, - ["cxc"] = { require("jdtls").extract_constant, "Extract Constant" }, - ["gs"] = { require("jdtls").super_implementation, "Goto Super" }, - ["gS"] = { require("jdtls.tests").goto_subjects, "Goto Subjects" }, - ["co"] = { require("jdtls").organize_imports, "Organize Imports" }, - }, { mode = "n", buffer = args.buf }) - wk.register({ - ["c"] = { name = "+code" }, - ["cx"] = { name = "+extract" }, - ["cxm"] = { - [[lua require('jdtls').extract_method(true)]], - "Extract Method", + wk.add({ + { + mode = "n", + buffer = args.buf, + { "cx", group = "extract" }, + { "cxv", require("jdtls").extract_variable_all, desc = "Extract Variable" }, + { "cxc", require("jdtls").extract_constant, desc = "Extract Constant" }, + { "gs", require("jdtls").super_implementation, desc = "Goto Super" }, + { "gS", require("jdtls.tests").goto_subjects, desc = "Goto Subjects" }, + { "co", require("jdtls").organize_imports, desc = "Organize Imports" }, }, - ["cxv"] = { - [[lua require('jdtls').extract_variable_all(true)]], - "Extract Variable", + }) + wk.add({ + { + mode = "v", + buffer = args.buf, + { "cx", group = "extract" }, + { + "cxm", + [[lua require('jdtls').extract_method(true)]], + desc = "Extract Method", + }, + { + "cxv", + [[lua require('jdtls').extract_variable_all(true)]], + desc = "Extract Variable", + }, + { + "cxc", + [[lua require('jdtls').extract_constant(true)]], + desc = "Extract Constant", + }, }, - ["cxc"] = { - [[lua require('jdtls').extract_constant(true)]], - "Extract Constant", - }, - }, { mode = "v", buffer = args.buf }) + }) if opts.dap and LazyVim.has("nvim-dap") and mason_registry.is_installed("java-debug-adapter") then -- custom init for Java debugger @@ -223,26 +233,32 @@ return { -- Java Test require Java debugger to work if opts.test and mason_registry.is_installed("java-test") then -- custom keymaps for Java test runner (not yet compatible with neotest) - wk.register({ - ["t"] = { name = "+test" }, - ["tt"] = { - function() - require("jdtls.dap").test_class({ - config_overrides = type(opts.test) ~= "boolean" and opts.test.config_overrides or nil, - }) - end, - "Run All Test", + wk.add({ + { + mode = "n", + buffer = args.buf, + { "t", group = "test" }, + { + "tt", + function() + require("jdtls.dap").test_class({ + config_overrides = type(opts.test) ~= "boolean" and opts.test.config_overrides or nil, + }) + end, + desc = "Run All Test", + }, + { + "tr", + function() + require("jdtls.dap").test_nearest_method({ + config_overrides = type(opts.test) ~= "boolean" and opts.test.config_overrides or nil, + }) + end, + desc = "Run Nearest Test", + }, + { "tT", require("jdtls.dap").pick_test, desc = "Run Test" }, }, - ["tr"] = { - function() - require("jdtls.dap").test_nearest_method({ - config_overrides = type(opts.test) ~= "boolean" and opts.test.config_overrides or nil, - }) - end, - "Run Nearest Test", - }, - ["tT"] = { require("jdtls.dap").pick_test, "Run Test" }, - }, { mode = "n", buffer = args.buf }) + }) end end From b4b02340084cbd835b6c32d50cc144a911e2ac8b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 13 Jul 2024 10:07:07 +0200 Subject: [PATCH 239/323] chore(update): update repository (#4009) Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action Co-authored-by: folke <292349+folke@users.noreply.github.com> --- .github/ISSUE_TEMPLATE/bug_report.yml | 37 ++++++++------------------- scripts/test | 2 +- 2 files changed, 12 insertions(+), 27 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 1a3f3100..5d0e00fa 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -6,7 +6,10 @@ body: - type: markdown attributes: value: | - **Before** reporting an issue, make sure to read the [documentation](https://github.com/LazyVim/LazyVim) and search [existing issues](https://github.com/LazyVim/LazyVim/issues). Usage questions such as ***"How do I...?"*** belong in [Discussions](https://github.com/LazyVim/LazyVim/discussions) and will be closed. + **Before** reporting an issue, make sure to read the [documentation](https://github.com/LazyVim/LazyVim) + and search [existing issues](https://github.com/LazyVim/LazyVim/issues). + + Usage questions such as ***"How do I...?"*** belong in [Discussions](https://github.com/LazyVim/LazyVim/discussions) and will be closed. - type: checkboxes attributes: label: Did you check docs and existing issues? @@ -57,33 +60,15 @@ body: label: Repro description: Minimal `init.lua` to reproduce this issue. Save as `repro.lua` and run with `nvim -u repro.lua` value: | - -- DO NOT change the paths and don't remove the colorscheme - local root = vim.fn.fnamemodify("./.repro", ":p") + vim.env.LAZY_STDPATH = ".repro" + load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))() - -- set stdpaths to use .repro - for _, name in ipairs({ "config", "data", "state", "cache" }) do - vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name - end - - -- bootstrap lazy - local lazypath = root .. "/plugins/lazy.nvim" - if not vim.loop.fs_stat(lazypath) then - vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, }) - end - vim.opt.runtimepath:prepend(lazypath) - - -- install plugins - local plugins = { - "folke/tokyonight.nvim", - { "LazyVim/LazyVim", import = "lazyvim.plugins" }, - -- add any other plugins here - } - require("lazy").setup(plugins, { - root = root .. "/plugins", + require("lazy.minit").repro({ + spec = { + { "LazyVim/LazyVim", import = "lazyvim.plugins" }, + -- add any other plugins here + }, }) - - vim.cmd.colorscheme("tokyonight") - -- add anything else here render: Lua validations: required: false diff --git a/scripts/test b/scripts/test index 4baf6215..ffbb5405 100755 --- a/scripts/test +++ b/scripts/test @@ -1,3 +1,3 @@ #!/bin/env bash -nvim -l tests/minit.lua --busted tests -o utfTerminal "$@" +nvim -l tests/minit.lua --minitest From 1f8469a53c9c878d52932818533ce51c27ded5b6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 13 Jul 2024 16:16:04 +0200 Subject: [PATCH 240/323] chore(update): update repository (#4018) Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action Co-authored-by: folke <292349+folke@users.noreply.github.com> --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 5d0e00fa..5d032ebd 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -69,6 +69,6 @@ body: -- add any other plugins here }, }) - render: Lua + render: lua validations: required: false From 431ceaf329729d4f9afe865c8722808cdbf1cbe9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 13 Jul 2024 18:09:42 +0200 Subject: [PATCH 241/323] chore(update): update repository (#4019) Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action Co-authored-by: folke <292349+folke@users.noreply.github.com> --- .editorconfig | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..18616d30 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,8 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 2 +charset = utf-8 From 75ff1496bd4209784a4250e59920d24d75a3e3b0 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 14 Jul 2024 07:08:17 +0200 Subject: [PATCH 242/323] feat: shorter keymap descriptions for mini.ai / yanky --- lua/lazyvim/plugins/extras/coding/yanky.lua | 8 ++--- lua/lazyvim/util/mini.lua | 34 ++++++++++++--------- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/lua/lazyvim/plugins/extras/coding/yanky.lua b/lua/lazyvim/plugins/extras/coding/yanky.lua index 02b3b18a..fbf8f9ef 100644 --- a/lua/lazyvim/plugins/extras/coding/yanky.lua +++ b/lua/lazyvim/plugins/extras/coding/yanky.lua @@ -21,10 +21,10 @@ return { }, -- stylua: ignore { "y", "(YankyYank)", mode = { "n", "x" }, desc = "Yank Text" }, - { "p", "(YankyPutAfter)", mode = { "n", "x" }, desc = "Put Yanked Text After Cursor" }, - { "P", "(YankyPutBefore)", mode = { "n", "x" }, desc = "Put Yanked Text Before Cursor" }, - { "gp", "(YankyGPutAfter)", mode = { "n", "x" }, desc = "Put Yanked Text After Selection" }, - { "gP", "(YankyGPutBefore)", mode = { "n", "x" }, desc = "Put Yanked Text Before Selection" }, + { "p", "(YankyPutAfter)", mode = { "n", "x" }, desc = "Put Text After Cursor" }, + { "P", "(YankyPutBefore)", mode = { "n", "x" }, desc = "Put Text Before Cursor" }, + { "gp", "(YankyGPutAfter)", mode = { "n", "x" }, desc = "Put Text After Selection" }, + { "gP", "(YankyGPutBefore)", mode = { "n", "x" }, desc = "Put Text Before Selection" }, { "[y", "(YankyCycleForward)", desc = "Cycle Forward Through Yank History" }, { "]y", "(YankyCycleBackward)", desc = "Cycle Backward Through Yank History" }, { "]p", "(YankyPutIndentAfterLinewise)", desc = "Put Indented After Cursor (Linewise)" }, diff --git a/lua/lazyvim/util/mini.lua b/lua/lazyvim/util/mini.lua index a35999c4..cdb27397 100644 --- a/lua/lazyvim/util/mini.lua +++ b/lua/lazyvim/util/mini.lua @@ -63,32 +63,32 @@ end function M.ai_whichkey() local objects = { { " ", desc = "whitespace" }, - { '"', desc = 'balanced "' }, - { "'", desc = "balanced '" }, - { "(", desc = "balanced (" }, - { ")", desc = "balanced ) including white-space" }, - { "<", desc = "balanced <" }, - { ">", desc = "balanced > including white-space" }, + { '"', desc = '" string' }, + { "'", desc = "' string" }, + { "(", desc = "() block" }, + { ")", desc = "() block with ws" }, + { "<", desc = "<> block" }, + { ">", desc = "<> block with ws" }, { "?", desc = "user prompt" }, - { "U", desc = "use/call without dot in name" }, - { "[", desc = "balanced [" }, - { "]", desc = "balanced ] including white-space" }, + { "U", desc = "use/call without dot" }, + { "[", desc = "[] block" }, + { "]", desc = "[] block with ws" }, { "_", desc = "underscore" }, - { "`", desc = "balanced `" }, + { "`", desc = "` string" }, { "a", desc = "argument" }, - { "b", desc = "balanced )]}" }, + { "b", desc = ")]} block" }, { "c", desc = "class" }, { "d", desc = "digit(s)" }, - { "e", desc = "word in CamelCase & snake_case" }, + { "e", desc = "CamelCase / snake_case" }, { "f", desc = "function" }, { "g", desc = "entire file" }, { "i", desc = "indent" }, { "o", desc = "block, conditional, loop" }, { "q", desc = "quote `\"'" }, { "t", desc = "tag" }, - { "u", desc = "use/call function & method" }, - { "{", desc = "balanced {" }, - { "}", desc = "balanced } including white-space" }, + { "u", desc = "use/call" }, + { "{", desc = "{} block" }, + { "}", desc = "{} with ws" }, } local ret = { mode = { "o", "x" } } @@ -102,6 +102,10 @@ function M.ai_whichkey() }) do ret[#ret + 1] = { prefix, group = name } for _, obj in ipairs(objects) do + local desc = obj.desc + if prefix:sub(1, 1) == "i" then + desc = desc:gsub(" with ws", "") + end ret[#ret + 1] = { prefix .. obj[1], desc = obj.desc } end end From d01a58ef904b9e11378e5c175f3389964c69169d Mon Sep 17 00:00:00 2001 From: folke Date: Sun, 14 Jul 2024 05:09:15 +0000 Subject: [PATCH 243/323] chore(build): auto-generate docs --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index cb32929e..50f726a8 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2024 July 13 +*LazyVim.txt* For Neovim Last change: 2024 July 14 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 065d72320d3f45a6a23f9f7a6a96830216cdd7f4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 14 Jul 2024 07:50:40 +0200 Subject: [PATCH 244/323] chore(main): release 12.29.0 (#4015) :robot: I have created a release *beep* *boop* --- ## [12.29.0](https://github.com/LazyVim/LazyVim/compare/v12.28.0...v12.29.0) (2024-07-14) ### Features * **java:** new java mappings format for which-key v3 ([#4013](https://github.com/LazyVim/LazyVim/issues/4013)) ([28a7f81](https://github.com/LazyVim/LazyVim/commit/28a7f8126c1b46b41ca58845ee081b67ce6981f2)) * shorter keymap descriptions for mini.ai / yanky ([75ff149](https://github.com/LazyVim/LazyVim/commit/75ff1496bd4209784a4250e59920d24d75a3e3b0)) ### Bug Fixes * **flit:** use which-key preset keymap descriptions ([#4000](https://github.com/LazyVim/LazyVim/issues/4000)) ([ca37162](https://github.com/LazyVim/LazyVim/commit/ca37162cb7452dce32cf3f0ad661bcd1245286c0)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/.release-please-manifest.json | 2 +- CHANGELOG.md | 13 +++++++++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index baee08c0..e652d074 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "12.28.0" + ".": "12.29.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f4832e0..42801903 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## [12.29.0](https://github.com/LazyVim/LazyVim/compare/v12.28.0...v12.29.0) (2024-07-14) + + +### Features + +* **java:** new java mappings format for which-key v3 ([#4013](https://github.com/LazyVim/LazyVim/issues/4013)) ([28a7f81](https://github.com/LazyVim/LazyVim/commit/28a7f8126c1b46b41ca58845ee081b67ce6981f2)) +* shorter keymap descriptions for mini.ai / yanky ([75ff149](https://github.com/LazyVim/LazyVim/commit/75ff1496bd4209784a4250e59920d24d75a3e3b0)) + + +### Bug Fixes + +* **flit:** use which-key preset keymap descriptions ([#4000](https://github.com/LazyVim/LazyVim/issues/4000)) ([ca37162](https://github.com/LazyVim/LazyVim/commit/ca37162cb7452dce32cf3f0ad661bcd1245286c0)) + ## [12.28.0](https://github.com/LazyVim/LazyVim/compare/v12.27.0...v12.28.0) (2024-07-12) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index be1cc91d..2a022be6 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "12.28.0" -- x-release-please-version +M.version = "12.29.0" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From 337e9ddc007d32c624433b5c6f0af6e8697dfcc6 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 14 Jul 2024 07:52:00 +0200 Subject: [PATCH 245/323] fix(pick): get rid of "auto" picker and set better defaults for telescope find_files (#4024) ## Description Changes telescope's `find_files` options to match `fzf-lua` that matches what `git_files` does including untracked files. ## Related Issue(s) Fixes #3974 ## Screenshots ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/editor/fzf.lua | 6 +++--- lua/lazyvim/plugins/extras/editor/telescope.lua | 12 +++++++++--- lua/lazyvim/util/pick.lua | 17 +---------------- 3 files changed, 13 insertions(+), 22 deletions(-) diff --git a/lua/lazyvim/plugins/extras/editor/fzf.lua b/lua/lazyvim/plugins/extras/editor/fzf.lua index cb2ab95d..e23af81b 100644 --- a/lua/lazyvim/plugins/extras/editor/fzf.lua +++ b/lua/lazyvim/plugins/extras/editor/fzf.lua @@ -211,12 +211,12 @@ return { }, { "/", LazyVim.pick("live_grep"), desc = "Grep (Root Dir)" }, { ":", "FzfLua command_history", desc = "Command History" }, - { "", LazyVim.pick("auto"), desc = "Find Files (Root Dir)" }, + { "", LazyVim.pick("files"), desc = "Find Files (Root Dir)" }, -- find { "fb", "FzfLua buffers sort_mru=true sort_lastused=true", desc = "Buffers" }, { "fc", LazyVim.pick.config_files(), desc = "Find Config File" }, - { "ff", LazyVim.pick("auto"), desc = "Find Files (Root Dir)" }, - { "fF", LazyVim.pick("auto", { root = false }), desc = "Find Files (cwd)" }, + { "ff", LazyVim.pick("files"), desc = "Find Files (Root Dir)" }, + { "fF", LazyVim.pick("files", { root = false }), desc = "Find Files (cwd)" }, { "fg", "FzfLua git_files", desc = "Find Files (git-files)" }, { "fr", "FzfLua oldfiles", desc = "Recent" }, { "fR", LazyVim.pick("oldfiles", { cwd = vim.uv.cwd() }), desc = "Recent (cwd)" }, diff --git a/lua/lazyvim/plugins/extras/editor/telescope.lua b/lua/lazyvim/plugins/extras/editor/telescope.lua index 9d40dcdf..c897d8cf 100644 --- a/lua/lazyvim/plugins/extras/editor/telescope.lua +++ b/lua/lazyvim/plugins/extras/editor/telescope.lua @@ -92,12 +92,12 @@ return { }, { "/", LazyVim.pick("live_grep"), desc = "Grep (Root Dir)" }, { ":", "Telescope command_history", desc = "Command History" }, - { "", LazyVim.pick("auto"), desc = "Find Files (Root Dir)" }, + { "", LazyVim.pick("files"), desc = "Find Files (Root Dir)" }, -- find { "fb", "Telescope buffers sort_mru=true sort_lastused=true", desc = "Buffers" }, { "fc", LazyVim.pick.config_files(), desc = "Find Config File" }, - { "ff", LazyVim.pick("auto"), desc = "Find Files (Root Dir)" }, - { "fF", LazyVim.pick("auto", { root = false }), desc = "Find Files (cwd)" }, + { "ff", LazyVim.pick("files"), desc = "Find Files (Root Dir)" }, + { "fF", LazyVim.pick("files", { root = false }), desc = "Find Files (cwd)" }, { "fg", "Telescope git_files", desc = "Find Files (git-files)" }, { "fr", "Telescope oldfiles", desc = "Recent" }, { "fR", LazyVim.pick("oldfiles", { cwd = vim.uv.cwd() }), desc = "Recent (cwd)" }, @@ -198,6 +198,12 @@ return { }, }, }, + pickers = { + find_files = { + find_command = { "fd", "--type", "f", "--color", "never", "-E", ".git" }, + hidden = true, + }, + }, } end, }, diff --git a/lua/lazyvim/util/pick.lua b/lua/lazyvim/util/pick.lua index 63037189..7ab2b482 100644 --- a/lua/lazyvim/util/pick.lua +++ b/lua/lazyvim/util/pick.lua @@ -57,7 +57,7 @@ function M.open(command, opts) return LazyVim.error("LazyVim.pick: picker not set") end - command = command or "auto" + command = command ~= "auto" and command or "files" opts = opts or {} opts = vim.deepcopy(opts) @@ -71,21 +71,6 @@ function M.open(command, opts) opts.cwd = LazyVim.root({ buf = opts.buf }) end - local cwd = opts.cwd or vim.uv.cwd() - if command == "auto" then - command = "files" - if - vim.uv.fs_stat(cwd .. "/.git") - and not vim.uv.fs_stat(cwd .. "/.ignore") - and not vim.uv.fs_stat(cwd .. "/.rgignore") - then - command = "git_files" - if opts.show_untracked == nil then - opts.show_untracked = true - opts.recurse_submodules = false - end - end - end command = M.picker.commands[command] or command M.picker.open(command, opts) end From b3e746b637a0d43aa0195cc1ff3d8adf1fedfaf6 Mon Sep 17 00:00:00 2001 From: Kurren Nischal Date: Sun, 14 Jul 2024 06:52:53 +0100 Subject: [PATCH 246/323] fix(omnisharp): don't detach coreclr debug adapter (#4023) ## Description Debugging c# with the Omnisharp plugin doesn't work, as described by myself in #4004. Turns out this is a known issue with how nvim-dap calls the mason netcoredbg cmd script. [The solution](https://github.com/jay-babu/mason-nvim-dap.nvim/issues/132) is to pass `detach = false` as an option to the debug adapter. I've tested and it works on my windows machine. ## Related Issue(s) #4004 ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/lang/omnisharp.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/lazyvim/plugins/extras/lang/omnisharp.lua b/lua/lazyvim/plugins/extras/lang/omnisharp.lua index fa0dac48..cac9cf5b 100644 --- a/lua/lazyvim/plugins/extras/lang/omnisharp.lua +++ b/lua/lazyvim/plugins/extras/lang/omnisharp.lua @@ -75,6 +75,9 @@ return { type = "executable", command = vim.fn.exepath("netcoredbg"), args = { "--interpreter=vscode" }, + options = { + detached = false, + }, } end for _, lang in ipairs({ "cs", "fsharp", "vb" }) do From 9bce054fafcd631ec133a82ada1ecbbd23ca5510 Mon Sep 17 00:00:00 2001 From: Siva Sivakumar Date: Sun, 14 Jul 2024 00:53:18 -0500 Subject: [PATCH 247/323] fix(tailwind): additional tailwind completion settings for phoenix projects (#3961) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Tailwind completions stopped working in Phoenix projects that have `HTML`, `HEEX` or `Elixir files with ~H sigils`. Broader discussion and recommended solution: https://github.com/tailwindlabs/tailwindcss-intellisense/issues/1002 ## Related Issue(s) ## Screenshots ![Screenshot 2024-07-08 at 9 05 45 PM](https://github.com/LazyVim/LazyVim/assets/379021/8572e6c1-12dd-454c-b60e-3b33ae448284) ![Screenshot 2024-07-08 at 9 05 08 PM](https://github.com/LazyVim/LazyVim/assets/379021/f93bdc28-813e-4485-b40d-146c1670b8c2) ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/lang/tailwind.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lua/lazyvim/plugins/extras/lang/tailwind.lua b/lua/lazyvim/plugins/extras/lang/tailwind.lua index def150a3..da6a3291 100644 --- a/lua/lazyvim/plugins/extras/lang/tailwind.lua +++ b/lua/lazyvim/plugins/extras/lang/tailwind.lua @@ -40,6 +40,17 @@ return { return not vim.tbl_contains(opts.filetypes_exclude or {}, ft) end, opts.filetypes) + -- Additional settings for Phoenix projects + opts.settings = { + tailwindCSS = { + includeLanguages = { + elixir = "html-eex", + eelixir = "html-eex", + heex = "html-eex", + }, + }, + } + -- Add additional filetypes vim.list_extend(opts.filetypes, opts.filetypes_include or {}) end, From 45af7e1fed5273b027105ecf4026e4c452cc7508 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 14 Jul 2024 07:54:09 +0200 Subject: [PATCH 248/323] chore(main): release 12.29.1 (#4026) :robot: I have created a release *beep* *boop* --- ## [12.29.1](https://github.com/LazyVim/LazyVim/compare/v12.29.0...v12.29.1) (2024-07-14) ### Bug Fixes * **omnisharp:** don't detach coreclr debug adapter ([#4023](https://github.com/LazyVim/LazyVim/issues/4023)) ([b3e746b](https://github.com/LazyVim/LazyVim/commit/b3e746b637a0d43aa0195cc1ff3d8adf1fedfaf6)) * **pick:** get rid of "auto" picker and set better defaults for telescope find_files ([#4024](https://github.com/LazyVim/LazyVim/issues/4024)) ([337e9dd](https://github.com/LazyVim/LazyVim/commit/337e9ddc007d32c624433b5c6f0af6e8697dfcc6)) * **tailwind:** additional tailwind completion settings for phoenix projects ([#3961](https://github.com/LazyVim/LazyVim/issues/3961)) ([9bce054](https://github.com/LazyVim/LazyVim/commit/9bce054fafcd631ec133a82ada1ecbbd23ca5510)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/.release-please-manifest.json | 2 +- CHANGELOG.md | 9 +++++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index e652d074..ba0f9879 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "12.29.0" + ".": "12.29.1" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 42801903..a2b14082 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [12.29.1](https://github.com/LazyVim/LazyVim/compare/v12.29.0...v12.29.1) (2024-07-14) + + +### Bug Fixes + +* **omnisharp:** don't detach coreclr debug adapter ([#4023](https://github.com/LazyVim/LazyVim/issues/4023)) ([b3e746b](https://github.com/LazyVim/LazyVim/commit/b3e746b637a0d43aa0195cc1ff3d8adf1fedfaf6)) +* **pick:** get rid of "auto" picker and set better defaults for telescope find_files ([#4024](https://github.com/LazyVim/LazyVim/issues/4024)) ([337e9dd](https://github.com/LazyVim/LazyVim/commit/337e9ddc007d32c624433b5c6f0af6e8697dfcc6)) +* **tailwind:** additional tailwind completion settings for phoenix projects ([#3961](https://github.com/LazyVim/LazyVim/issues/3961)) ([9bce054](https://github.com/LazyVim/LazyVim/commit/9bce054fafcd631ec133a82ada1ecbbd23ca5510)) + ## [12.29.0](https://github.com/LazyVim/LazyVim/compare/v12.28.0...v12.29.0) (2024-07-14) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 2a022be6..85ae4bd4 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "12.29.0" -- x-release-please-version +M.version = "12.29.1" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From d39cdb059624b1200f2ef762f30c6e3b74066bc5 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 14 Jul 2024 18:06:40 +0200 Subject: [PATCH 249/323] fix(telescope): better find_command. Fixes #4031 --- lua/lazyvim/plugins/extras/editor/telescope.lua | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/editor/telescope.lua b/lua/lazyvim/plugins/extras/editor/telescope.lua index c897d8cf..11cfef1b 100644 --- a/lua/lazyvim/plugins/extras/editor/telescope.lua +++ b/lua/lazyvim/plugins/extras/editor/telescope.lua @@ -165,6 +165,20 @@ return { LazyVim.pick("find_files", { hidden = true, default_text = line })() end + local function find_command() + if 1 == vim.fn.executable("rg") then + return { "rg", "--files", "--color", "never", "-g", "!.git" } + elseif 1 == vim.fn.executable("fd") then + return { "fd", "--type", "f", "--color", "never", "-E", ".git" } + elseif 1 == vim.fn.executable("fdfind") then + return { "fdfind", "--type", "f", "--color", "never", "-E", ".git" } + elseif 1 == vim.fn.executable("find") and vim.fn.has("win32") == 0 then + return { "find", ".", "-type", "f" } + elseif 1 == vim.fn.executable("where") then + return { "where", "/r", ".", "*" } + end + end + return { defaults = { prompt_prefix = " ", @@ -200,7 +214,7 @@ return { }, pickers = { find_files = { - find_command = { "fd", "--type", "f", "--color", "never", "-E", ".git" }, + find_command = find_command, hidden = true, }, }, From b20be638b3563cce0823b161a909f7702aaa64b5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 14 Jul 2024 18:08:14 +0200 Subject: [PATCH 250/323] chore(main): release 12.29.2 (#4035) :robot: I have created a release *beep* *boop* --- ## [12.29.2](https://github.com/LazyVim/LazyVim/compare/v12.29.1...v12.29.2) (2024-07-14) ### Bug Fixes * **telescope:** better find_command. Fixes [#4031](https://github.com/LazyVim/LazyVim/issues/4031) ([d39cdb0](https://github.com/LazyVim/LazyVim/commit/d39cdb059624b1200f2ef762f30c6e3b74066bc5)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/.release-please-manifest.json | 2 +- CHANGELOG.md | 7 +++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index ba0f9879..67008812 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "12.29.1" + ".": "12.29.2" } diff --git a/CHANGELOG.md b/CHANGELOG.md index a2b14082..b39b4a5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [12.29.2](https://github.com/LazyVim/LazyVim/compare/v12.29.1...v12.29.2) (2024-07-14) + + +### Bug Fixes + +* **telescope:** better find_command. Fixes [#4031](https://github.com/LazyVim/LazyVim/issues/4031) ([d39cdb0](https://github.com/LazyVim/LazyVim/commit/d39cdb059624b1200f2ef762f30c6e3b74066bc5)) + ## [12.29.1](https://github.com/LazyVim/LazyVim/compare/v12.29.0...v12.29.1) (2024-07-14) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 85ae4bd4..3616f826 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "12.29.1" -- x-release-please-version +M.version = "12.29.2" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From 29e285d8825e3e82bd85c74bb808fadd5cb41b6d Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 14 Jul 2024 18:11:15 +0200 Subject: [PATCH 251/323] style(persistence): remove unused option --- lua/lazyvim/plugins/util.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/util.lua b/lua/lazyvim/plugins/util.lua index cf5d9e03..16706c51 100644 --- a/lua/lazyvim/plugins/util.lua +++ b/lua/lazyvim/plugins/util.lua @@ -6,7 +6,7 @@ return { { "folke/persistence.nvim", event = "BufReadPre", - opts = { options = vim.opt.sessionoptions:get() }, + opts = {}, -- stylua: ignore keys = { { "qs", function() require("persistence").load() end, desc = "Restore Session" }, From e80ed322a79a8b9857c6ab0ad76545654917ddcb Mon Sep 17 00:00:00 2001 From: Lucas Date: Sun, 14 Jul 2024 18:19:28 +0200 Subject: [PATCH 252/323] perf(luasnip): luasnip wasn't lazyloaded (#4032) ## Description this makes the extra luasnip lazy load at the same time as nvim cmp. just putting `lazy = true` works because `nvim-cmp` when being loaded with `InsertEnter` also load `cmp-luasnip`, which itself load `LUASNIP`. you can see the problem in the following discussion https://github.com/LazyVim/LazyVim/discussions/3966 where luasnip was not lazy loaded when starting lazyvim. This was also loading nvim-cmp and all its dep when starting lazyvim, which negatively impacted performance. ## Related Issue(s) https://github.com/LazyVim/LazyVim/discussions/3966 ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/coding/luasnip.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/extras/coding/luasnip.lua b/lua/lazyvim/plugins/extras/coding/luasnip.lua index f0aadc4f..47bd80c4 100644 --- a/lua/lazyvim/plugins/extras/coding/luasnip.lua +++ b/lua/lazyvim/plugins/extras/coding/luasnip.lua @@ -1,6 +1,7 @@ return { { "L3MON4D3/LuaSnip", + lazy = true, build = (not LazyVim.is_win()) and "echo 'NOTE: jsregexp is optional, so not a big deal if it fails to build'; make install_jsregexp" or nil, From 8506cb5a98a528651a5557d8e447fa13bd8ac0cb Mon Sep 17 00:00:00 2001 From: Johnson Hu Date: Mon, 15 Jul 2024 15:06:34 +0800 Subject: [PATCH 253/323] feat(util.mini): follow the user's mappings instead of hardcoded values (#4043) Because I use the Colemak-DH keyboard layout, I have mapped 'i' to 'h'. Therefore, the current mini.ai which_key prompts are inconsistent with my keymap. ## Description The names and prefixes used in mini.ai_whichkey() are hardcoded and should follow the user's mappings. ## Related Issue(s) No ## Screenshots No ## Checklist - [ x ] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --------- Co-authored-by: Folke Lemaitre --- lua/lazyvim/plugins/coding.lua | 11 ++++++++--- lua/lazyvim/util/mini.lua | 25 ++++++++++++++++--------- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index ffd743b3..e4ce97d2 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -171,9 +171,6 @@ return { "echasnovski/mini.ai", event = "VeryLazy", opts = function() - LazyVim.on_load("which-key.nvim", function() - vim.schedule(LazyVim.mini.ai_whichkey) - end) local ai = require("mini.ai") return { n_lines = 500, @@ -197,6 +194,14 @@ return { }, } end, + config = function(_, opts) + require("mini.ai").setup(opts) + LazyVim.on_load("which-key.nvim", function() + vim.schedule(function() + LazyVim.mini.ai_whichkey(opts) + end) + end) + end, }, { diff --git a/lua/lazyvim/util/mini.lua b/lua/lazyvim/util/mini.lua index cdb27397..28c069da 100644 --- a/lua/lazyvim/util/mini.lua +++ b/lua/lazyvim/util/mini.lua @@ -60,7 +60,8 @@ function M.ai_buffer(ai_type) end -- register all text objects with which-key -function M.ai_whichkey() +---@param opts table +function M.ai_whichkey(opts) local objects = { { " ", desc = "whitespace" }, { '"', desc = '" string' }, @@ -92,14 +93,20 @@ function M.ai_whichkey() } local ret = { mode = { "o", "x" } } - for prefix, name in pairs({ - i = "inside", - a = "around", - il = "last", - ["in"] = "next", - al = "last", - an = "next", - }) do + ---@type table + local mappings = vim.tbl_extend("force", {}, { + around = "a", + inside = "i", + around_next = "an", + inside_next = "in", + around_last = "al", + inside_last = "il", + }, opts.mappings or {}) + mappings.goto_left = nil + mappings.goto_right = nil + + for name, prefix in pairs(mappings) do + name = name:gsub("^around_", ""):gsub("^inside_", "") ret[#ret + 1] = { prefix, group = name } for _, obj in ipairs(objects) do local desc = obj.desc From 448e15862aff675add1116ac2d62a0e743b7c9cd Mon Sep 17 00:00:00 2001 From: folke Date: Mon, 15 Jul 2024 07:07:24 +0000 Subject: [PATCH 254/323] chore(build): auto-generate docs --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 50f726a8..30cdbd12 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2024 July 14 +*LazyVim.txt* For Neovim Last change: 2024 July 15 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 0f2d01dd0121b4406ef877089877ad3f3f14e3a3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 15 Jul 2024 11:19:44 +0200 Subject: [PATCH 255/323] chore(update): update repository (#4047) Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action Co-authored-by: folke <292349+folke@users.noreply.github.com> --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 5d032ebd..16bf6ed1 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -17,6 +17,8 @@ body: options: - label: I have read all the LazyVim docs required: true + - label: I have updated the plugin to the latest version before submitting this issue + required: true - label: I have searched the existing issues of LazyVim required: true - label: I have searched the existing issues of plugins related to this issue From 6911327a5edca85ce3bc71229236494d9af7fafa Mon Sep 17 00:00:00 2001 From: Jelte Fennema-Nio Date: Mon, 15 Jul 2024 11:48:58 +0200 Subject: [PATCH 256/323] fix(yanky): enable yank history in visual mode (#4048) ## Description Being able to select from the yank history is useful if you want to paste over something else by first selecting the stuff you want to remove in visual mode. ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/coding/yanky.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/extras/coding/yanky.lua b/lua/lazyvim/plugins/extras/coding/yanky.lua index fbf8f9ef..c880aceb 100644 --- a/lua/lazyvim/plugins/extras/coding/yanky.lua +++ b/lua/lazyvim/plugins/extras/coding/yanky.lua @@ -17,6 +17,7 @@ return { vim.cmd([[YankyRingHistory]]) end end, + mode = { "n", "x" }, desc = "Open Yank History", }, -- stylua: ignore From 706ec4b6b6be4265cbcfd326d3216f2a29952b55 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 15 Jul 2024 14:05:49 +0200 Subject: [PATCH 257/323] fix(lsp): lsp keymaps. Fixes #4051 --- lua/lazyvim/plugins/lsp/keymaps.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lua/lazyvim/plugins/lsp/keymaps.lua b/lua/lazyvim/plugins/lsp/keymaps.lua index 12ae59be..2a35dc97 100644 --- a/lua/lazyvim/plugins/lsp/keymaps.lua +++ b/lua/lazyvim/plugins/lsp/keymaps.lua @@ -14,10 +14,10 @@ function M.get() -- stylua: ignore M._keys = { { "cl", "LspInfo", desc = "Lsp Info" }, - { "gd", vim.lsp.buf.definition(), desc = "Goto Definition", has = "definition" }, - { "gr", vim.lsp.buf.references(), desc = "References", nowait = true }, - { "gI", vim.lsp.buf.implementation(), desc = "Goto Implementation" }, - { "gy", vim.lsp.buf.type_definition(), desc = "Goto T[y]pe Definition" }, + { "gd", vim.lsp.buf.definition, desc = "Goto Definition", has = "definition" }, + { "gr", vim.lsp.buf.references, desc = "References", nowait = true }, + { "gI", vim.lsp.buf.implementation, desc = "Goto Implementation" }, + { "gy", vim.lsp.buf.type_definition, desc = "Goto T[y]pe Definition" }, { "gD", vim.lsp.buf.declaration, desc = "Goto Declaration" }, { "K", vim.lsp.buf.hover, desc = "Hover" }, { "gK", vim.lsp.buf.signature_help, desc = "Signature Help", has = "signatureHelp" }, From 78cf0320bfc34050883cde5e7af267184dc60ee9 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 15 Jul 2024 15:47:44 +0200 Subject: [PATCH 258/323] feat(keymaps): dynamic which-key icons/descriptions for toggles (#4050) ## Description ## Related Issue(s) - [ ] Closes #4025 ## Screenshots ![image](https://github.com/user-attachments/assets/8453c23c-d560-490c-9f96-a22ea88f45fd) ## Checklist - [ ] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/config/keymaps.lua | 27 +- lua/lazyvim/plugins/coding.lua | 14 - lua/lazyvim/plugins/editor.lua | 6 +- .../plugins/extras/ui/mini-animate.lua | 10 + lua/lazyvim/plugins/lsp/init.lua | 7 +- lua/lazyvim/plugins/treesitter.lua | 10 + lua/lazyvim/util/format.lua | 13 +- lua/lazyvim/util/mini.lua | 9 + lua/lazyvim/util/toggle.lua | 252 +++++++++++------- 9 files changed, 217 insertions(+), 131 deletions(-) diff --git a/lua/lazyvim/config/keymaps.lua b/lua/lazyvim/config/keymaps.lua index 48ae24f8..f568bdac 100644 --- a/lua/lazyvim/config/keymaps.lua +++ b/lua/lazyvim/config/keymaps.lua @@ -115,20 +115,19 @@ map("n", "[w", diagnostic_goto(false, "WARN"), { desc = "Prev Warning" }) -- stylua: ignore start -- toggle options -map("n", "uf", function() LazyVim.format.toggle() end, { desc = "Toggle Auto Format (Global)" }) -map("n", "uF", function() LazyVim.format.toggle(true) end, { desc = "Toggle Auto Format (Buffer)" }) -map("n", "us", function() LazyVim.toggle("spell") end, { desc = "Toggle Spelling" }) -map("n", "uw", function() LazyVim.toggle("wrap") end, { desc = "Toggle Word Wrap" }) -map("n", "uL", function() LazyVim.toggle("relativenumber") end, { desc = "Toggle Relative Line Numbers" }) -map("n", "ul", function() LazyVim.toggle.number() end, { desc = "Toggle Line Numbers" }) -map("n", "ud", function() LazyVim.toggle.diagnostics() end, { desc = "Toggle Diagnostics" }) -local conceallevel = vim.o.conceallevel > 0 and vim.o.conceallevel or 3 -map("n", "uc", function() LazyVim.toggle("conceallevel", false, {0, conceallevel}) end, { desc = "Toggle Conceal" }) -if vim.lsp.buf.inlay_hint or vim.lsp.inlay_hint then - map( "n", "uh", function() LazyVim.toggle.inlay_hints() end, { desc = "Toggle Inlay Hints" }) +LazyVim.toggle.map("uf", LazyVim.toggle.format()) +LazyVim.toggle.map("uF", LazyVim.toggle.format(true)) +LazyVim.toggle.map("us", LazyVim.toggle("spell", { name = "Spelling" })) +LazyVim.toggle.map("uw", LazyVim.toggle("wrap", { name = "Wrap" })) +LazyVim.toggle.map("uL", LazyVim.toggle("relativenumber", { name = "Relative Number" })) +LazyVim.toggle.map("ud", LazyVim.toggle.diagnostics) +LazyVim.toggle.map("ul", LazyVim.toggle.number) +LazyVim.toggle.map( "uc", LazyVim.toggle("conceallevel", { values = { 0, vim.o.conceallevel > 0 and vim.o.conceallevel or 2 } })) +LazyVim.toggle.map("uT", LazyVim.toggle.treesitter) +LazyVim.toggle.map("ub", LazyVim.toggle("background", { values = { "light", "dark" }, name = "Background" })) +if vim.lsp.inlay_hint then + LazyVim.toggle.map("uh", LazyVim.toggle.inlay_hints) end -map("n", "uT", function() if vim.b.ts_highlight then vim.treesitter.stop() else vim.treesitter.start() end end, { desc = "Toggle Treesitter Highlight" }) -map("n", "ub", function() LazyVim.toggle("background", false, {"light", "dark"}) end, { desc = "Toggle Background" }) -- lazygit map("n", "gg", function() LazyVim.lazygit( { cwd = LazyVim.root.git() }) end, { desc = "Lazygit (Root Dir)" }) @@ -181,7 +180,7 @@ map("n", "w-", "s", { desc = "Split Window Below", remap = true }) map("n", "w|", "v", { desc = "Split Window Right", remap = true }) map("n", "-", "s", { desc = "Split Window Below", remap = true }) map("n", "|", "v", { desc = "Split Window Right", remap = true }) -map("n", "wm", function() LazyVim.toggle.maximize() end, { desc = "Maximize Toggle" }) +LazyVim.toggle.map("wm", LazyVim.toggle.maximize) -- tabs map("n", "l", "tablast", { desc = "Last Tab" }) diff --git a/lua/lazyvim/plugins/coding.lua b/lua/lazyvim/plugins/coding.lua index e4ce97d2..8b982033 100644 --- a/lua/lazyvim/plugins/coding.lua +++ b/lua/lazyvim/plugins/coding.lua @@ -140,20 +140,6 @@ return { -- better deal with markdown code blocks markdown = true, }, - keys = { - { - "up", - function() - vim.g.minipairs_disable = not vim.g.minipairs_disable - if vim.g.minipairs_disable then - LazyVim.warn("Disabled auto pairs", { title = "Option" }) - else - LazyVim.info("Enabled auto pairs", { title = "Option" }) - end - end, - desc = "Toggle Auto Pairs", - }, - }, config = function(_, opts) LazyVim.mini.pairs(opts) end, diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 5bdbcb12..00401e61 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -176,9 +176,9 @@ return { { "gh", group = "hunks" }, { "q", group = "quit/session" }, { "s", group = "search" }, - { "u", group = "ui" }, + { "u", group = "ui", icon = { icon = "󰙵 ", color = "cyan" } }, { "w", group = "windows" }, - { "x", group = "diagnostics/quickfix" }, + { "x", group = "diagnostics/quickfix", icon = { icon = "󱖫 ", color = "green" } }, { "[", group = "prev" }, { "]", group = "next" }, { "g", group = "goto" }, @@ -193,7 +193,7 @@ return { function() require("which-key").show({ global = false }) end, - desc = "Buffer Local Keymaps (which-key)", + desc = "Buffer Keymaps (which-key)", }, }, config = function(_, opts) diff --git a/lua/lazyvim/plugins/extras/ui/mini-animate.lua b/lua/lazyvim/plugins/extras/ui/mini-animate.lua index c1f44d6d..571bee26 100644 --- a/lua/lazyvim/plugins/extras/ui/mini-animate.lua +++ b/lua/lazyvim/plugins/extras/ui/mini-animate.lua @@ -14,6 +14,16 @@ return { end, { expr = true }) end + LazyVim.toggle.map("ua", { + name = "Mini Animate", + get = function() + return not vim.g.minianimate_disable + end, + set = function(state) + vim.g.minianimate_disable = not state + end, + }) + local animate = require("mini.animate") return { resize = { diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index 5e6f3543..0747547f 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -7,9 +7,9 @@ return { "mason.nvim", { "williamboman/mason-lspconfig.nvim", config = function() end }, }, - ---@class PluginLspOpts opts = function() - return { + ---@class PluginLspOpts + local ret = { -- options for vim.diagnostic.config() ---@type vim.diagnostic.Opts diagnostics = { @@ -114,6 +114,7 @@ return { -- ["*"] = function(server, opts) end, }, } + return ret end, ---@param opts PluginLspOpts config = function(_, opts) @@ -150,7 +151,7 @@ return { and vim.bo[buffer].buftype == "" and not vim.tbl_contains(opts.inlay_hints.exclude, vim.bo[buffer].filetype) then - LazyVim.toggle.inlay_hints(buffer, true) + vim.lsp.inlay_hint.enable(true, { bufnr = buffer }) end end) end diff --git a/lua/lazyvim/plugins/treesitter.lua b/lua/lazyvim/plugins/treesitter.lua index 7bd2d091..0f0c8fe8 100644 --- a/lua/lazyvim/plugins/treesitter.lua +++ b/lua/lazyvim/plugins/treesitter.lua @@ -1,4 +1,14 @@ return { + { + "folke/which-key.nvim", + opts = { + spec = { + { "", desc = "Decrement Selection", mode = "x" }, + { "", desc = "Increment Selection", mode = { "x", "n" } }, + }, + }, + }, + -- Treesitter is a new parser generator tool that we can -- use in Neovim to power faster and more accurate -- syntax highlighting. diff --git a/lua/lazyvim/util/format.lua b/lua/lazyvim/util/format.lua index e6325538..de6ad052 100644 --- a/lua/lazyvim/util/format.lua +++ b/lua/lazyvim/util/format.lua @@ -97,10 +97,19 @@ end ---@param buf? boolean function M.toggle(buf) + M.enable(not M.enabled(), buf) +end + +---@param enable? boolean +---@param buf? boolean +function M.enable(enable, buf) + if enable == nil then + enable = true + end if buf then - vim.b.autoformat = not M.enabled() + vim.b.autoformat = enable else - vim.g.autoformat = not M.enabled() + vim.g.autoformat = enable vim.b.autoformat = nil end M.info() diff --git a/lua/lazyvim/util/mini.lua b/lua/lazyvim/util/mini.lua index 28c069da..e7320a73 100644 --- a/lua/lazyvim/util/mini.lua +++ b/lua/lazyvim/util/mini.lua @@ -121,6 +121,15 @@ end ---@param opts {skip_next: string, skip_ts: string[], skip_unbalanced: boolean, markdown: boolean} function M.pairs(opts) + LazyVim.toggle.map("up", { + name = "Mini Pairs", + get = function() + return not vim.g.minipairs_disable + end, + set = function(state) + vim.g.minipairs_disable = not state + end, + }) local pairs = require("mini.pairs") pairs.setup(opts) local open = pairs.open diff --git a/lua/lazyvim/util/toggle.lua b/lua/lazyvim/util/toggle.lua index 95bb3e76..99721e06 100644 --- a/lua/lazyvim/util/toggle.lua +++ b/lua/lazyvim/util/toggle.lua @@ -1,114 +1,176 @@ ---@class lazyvim.util.toggle local M = {} ----@param silent boolean? ----@param values? {[1]:any, [2]:any} -function M.option(option, silent, values) - if values then - if vim.opt_local[option]:get() == values[1] then - ---@diagnostic disable-next-line: no-unknown - vim.opt_local[option] = values[2] +---@class lazyvim.Toggle +---@field name string +---@field get fun():boolean +---@field set fun(state:boolean) +---@overload fun() +local T = {} +T.__index = T + +---@param lhs string +---@param toggle lazyvim.Toggle +function M.map(lhs, toggle) + LazyVim.safe_keymap_set("n", lhs, function() + local state = not toggle.get() + toggle.set(state) + if state then + LazyVim.info("Enabled " .. toggle.name, { title = toggle.name }) else - ---@diagnostic disable-next-line: no-unknown - vim.opt_local[option] = values[1] + LazyVim.warn("Disabled " .. toggle.name, { title = toggle.name }) end - return LazyVim.info("Set " .. option .. " to " .. vim.opt_local[option]:get(), { title = "Option" }) + end, { desc = "Toggle" .. toggle.name }) + M.wk(lhs, toggle) +end + +function M.wk(lhs, toggle) + if not LazyVim.has("which-key.nvim") then + return end - ---@diagnostic disable-next-line: no-unknown - vim.opt_local[option] = not vim.opt_local[option]:get() - if not silent then - if vim.opt_local[option]:get() then - LazyVim.info("Enabled " .. option, { title = "Option" }) + require("which-key").add({ + { + lhs, + icon = function() + return toggle.get() and { icon = " ", color = "green" } or { icon = " ", color = "yellow" } + end, + desc = function() + return (toggle.get() and "Disable " or "Enable ") .. toggle.name + end, + }, + }) +end + +---@type lazyvim.Toggle +M.treesitter = { + name = "Treesitter Highlight", + get = function() + return vim.b.ts_highlight + end, + set = function(state) + if state then + vim.treesitter.start() else - LazyVim.warn("Disabled " .. option, { title = "Option" }) + vim.treesitter.stop() end - end + end, +} + +---@param buf? boolean +function M.format(buf) + ---@type lazyvim.Toggle + local ret = { + name = "Auto Format (" .. (buf and "Buffer" or "Global") .. ")", + get = function() + if not buf then + return vim.g.autoformat == nil or vim.g.autoformat + end + return LazyVim.format.enabled() + end, + set = function(state) + LazyVim.format.enable(state, buf) + end, + } + return ret +end + +---@param opts? {values?: {[1]:any, [2]:any}, name?: string} +function M.option(option, opts) + opts = opts or {} + local name = opts.name or option + local on = opts.values and opts.values[2] or true + local off = opts.values and opts.values[1] or false + ---@type lazyvim.Toggle + local ret = { + name = name, + get = function() + return vim.opt_local[option]:get() == on + end, + set = function(state) + vim.opt_local[option] = state and on or off + end, + } + return ret end local nu = { number = true, relativenumber = true } -function M.number() - if vim.opt_local.number:get() or vim.opt_local.relativenumber:get() then - nu = { number = vim.opt_local.number:get(), relativenumber = vim.opt_local.relativenumber:get() } - vim.opt_local.number = false - vim.opt_local.relativenumber = false - LazyVim.warn("Disabled line numbers", { title = "Option" }) - else - vim.opt_local.number = nu.number - vim.opt_local.relativenumber = nu.relativenumber - LazyVim.info("Enabled line numbers", { title = "Option" }) - end -end - -local enabled = true -function M.diagnostics() - -- if this Neovim version supports checking if diagnostics are enabled - -- then use that for the current state - if vim.diagnostic.is_enabled then - enabled = vim.diagnostic.is_enabled() - elseif vim.diagnostic.is_disabled then - enabled = not vim.diagnostic.is_disabled() - end - enabled = not enabled - - if enabled then - vim.diagnostic.enable() - LazyVim.info("Enabled diagnostics", { title = "Diagnostics" }) - else - vim.diagnostic.disable() - LazyVim.warn("Disabled diagnostics", { title = "Diagnostics" }) - end -end - ----@param buf? number ----@param value? boolean -function M.inlay_hints(buf, value) - local ih = vim.lsp.buf.inlay_hint or vim.lsp.inlay_hint - if type(ih) == "function" then - ih(buf, value) - elseif type(ih) == "table" and ih.enable then - if value == nil then - value = not ih.is_enabled({ bufnr = buf or 0 }) +---@type lazyvim.Toggle +M.number = { + name = "Line Numbers", + get = function() + return vim.opt_local.number:get() or vim.opt_local.relativenumber:get() + end, + set = function(state) + if state then + vim.opt_local.number = nu.number + vim.opt_local.relativenumber = nu.relativenumber + else + nu = { number = vim.opt_local.number:get(), relativenumber = vim.opt_local.relativenumber:get() } + vim.opt_local.number = false + vim.opt_local.relativenumber = false end - ih.enable(value, { bufnr = buf }) - end -end + end, +} + +---@type lazyvim.Toggle +M.diagnostics = { + name = "Diagnostics", + get = function() + return vim.diagnostic.is_enabled and vim.diagnostic.is_enabled() + end, + set = vim.diagnostic.enable, +} + +---@type lazyvim.Toggle +M.inlay_hints = { + name = "Inlay Hints", + get = function() + return vim.lsp.inlay_hint.is_enabled({ bufnr = 0 }) + end, + set = function(state) + vim.lsp.inlay_hint.enable(state, { bufnr = 0 }) + end, +} ---@type {k:string, v:any}[] M._maximized = nil ----@param state boolean? -function M.maximize(state) - if state == (M._maximized ~= nil) then - return - end - if M._maximized then - for _, opt in ipairs(M._maximized) do - vim.o[opt.k] = opt.v +---@type lazyvim.Toggle +M.maximize = { + name = "Maximize", + get = function() + return M._maximized ~= nil + end, + set = function(state) + if state then + M._maximized = {} + local function set(k, v) + table.insert(M._maximized, 1, { k = k, v = vim.o[k] }) + vim.o[k] = v + end + set("winwidth", 999) + set("winheight", 999) + set("winminwidth", 10) + set("winminheight", 4) + vim.cmd("wincmd =") + -- `QuitPre` seems to be executed even if we quit a normal window, so we don't want that + -- `VimLeavePre` might be another consideration? Not sure about differences between the 2 + vim.api.nvim_create_autocmd("ExitPre", { + once = true, + group = vim.api.nvim_create_augroup("lazyvim_restore_max_exit_pre", { clear = true }), + desc = "Restore width/height when close Neovim while maximized", + callback = function() + M.maximize.set(false) + end, + }) + else + for _, opt in ipairs(M._maximized) do + vim.o[opt.k] = opt.v + end + M._maximized = nil + vim.cmd("wincmd =") end - M._maximized = nil - vim.cmd("wincmd =") - else - M._maximized = {} - local function set(k, v) - table.insert(M._maximized, 1, { k = k, v = vim.o[k] }) - vim.o[k] = v - end - set("winwidth", 999) - set("winheight", 999) - set("winminwidth", 10) - set("winminheight", 4) - vim.cmd("wincmd =") - end - -- `QuitPre` seems to be executed even if we quit a normal window, so we don't want that - -- `VimLeavePre` might be another consideration? Not sure about differences between the 2 - vim.api.nvim_create_autocmd("ExitPre", { - once = true, - group = vim.api.nvim_create_augroup("lazyvim_restore_max_exit_pre", { clear = true }), - desc = "Restore width/height when close Neovim while maximized", - callback = function() - M.maximize(false) - end, - }) -end + end, +} setmetatable(M, { __call = function(m, ...) From 9eefc6a3aaeb1a0742e676ba32c6963d649d3ca9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 15 Jul 2024 15:49:29 +0200 Subject: [PATCH 259/323] chore(main): release 12.30.0 (#4036) :robot: I have created a release *beep* *boop* --- ## [12.30.0](https://github.com/LazyVim/LazyVim/compare/v12.29.2...v12.30.0) (2024-07-15) ### Features * **keymaps:** dynamic which-key icons/descriptions for toggles ([#4050](https://github.com/LazyVim/LazyVim/issues/4050)) ([78cf032](https://github.com/LazyVim/LazyVim/commit/78cf0320bfc34050883cde5e7af267184dc60ee9)) * **util.mini:** follow the user's mappings instead of hardcoded values ([#4043](https://github.com/LazyVim/LazyVim/issues/4043)) ([8506cb5](https://github.com/LazyVim/LazyVim/commit/8506cb5a98a528651a5557d8e447fa13bd8ac0cb)) ### Bug Fixes * **lsp:** lsp keymaps. Fixes [#4051](https://github.com/LazyVim/LazyVim/issues/4051) ([706ec4b](https://github.com/LazyVim/LazyVim/commit/706ec4b6b6be4265cbcfd326d3216f2a29952b55)) * **yanky:** enable yank history in visual mode ([#4048](https://github.com/LazyVim/LazyVim/issues/4048)) ([6911327](https://github.com/LazyVim/LazyVim/commit/6911327a5edca85ce3bc71229236494d9af7fafa)) ### Performance Improvements * **luasnip:** luasnip wasn't lazyloaded ([#4032](https://github.com/LazyVim/LazyVim/issues/4032)) ([e80ed32](https://github.com/LazyVim/LazyVim/commit/e80ed322a79a8b9857c6ab0ad76545654917ddcb)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/.release-please-manifest.json | 2 +- CHANGELOG.md | 19 +++++++++++++++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index 67008812..1abbe376 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "12.29.2" + ".": "12.30.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index b39b4a5e..f7f74112 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +## [12.30.0](https://github.com/LazyVim/LazyVim/compare/v12.29.2...v12.30.0) (2024-07-15) + + +### Features + +* **keymaps:** dynamic which-key icons/descriptions for toggles ([#4050](https://github.com/LazyVim/LazyVim/issues/4050)) ([78cf032](https://github.com/LazyVim/LazyVim/commit/78cf0320bfc34050883cde5e7af267184dc60ee9)) +* **util.mini:** follow the user's mappings instead of hardcoded values ([#4043](https://github.com/LazyVim/LazyVim/issues/4043)) ([8506cb5](https://github.com/LazyVim/LazyVim/commit/8506cb5a98a528651a5557d8e447fa13bd8ac0cb)) + + +### Bug Fixes + +* **lsp:** lsp keymaps. Fixes [#4051](https://github.com/LazyVim/LazyVim/issues/4051) ([706ec4b](https://github.com/LazyVim/LazyVim/commit/706ec4b6b6be4265cbcfd326d3216f2a29952b55)) +* **yanky:** enable yank history in visual mode ([#4048](https://github.com/LazyVim/LazyVim/issues/4048)) ([6911327](https://github.com/LazyVim/LazyVim/commit/6911327a5edca85ce3bc71229236494d9af7fafa)) + + +### Performance Improvements + +* **luasnip:** luasnip wasn't lazyloaded ([#4032](https://github.com/LazyVim/LazyVim/issues/4032)) ([e80ed32](https://github.com/LazyVim/LazyVim/commit/e80ed322a79a8b9857c6ab0ad76545654917ddcb)) + ## [12.29.2](https://github.com/LazyVim/LazyVim/compare/v12.29.1...v12.29.2) (2024-07-14) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 3616f826..08029fc9 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "12.29.2" -- x-release-please-version +M.version = "12.30.0" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From dc8a3a139e9986292e99b75e530fc3d9168fc001 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 15 Jul 2024 17:09:19 +0200 Subject: [PATCH 260/323] chore(update): update repository (#4054) Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action Co-authored-by: folke <292349+folke@users.noreply.github.com> --- .editorconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index 18616d30..8b176d56 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,7 +1,6 @@ root = true [*] -end_of_line = lf insert_final_newline = true indent_style = space indent_size = 2 From ab0135093bc18ccf82325bc8ee14c25230a71786 Mon Sep 17 00:00:00 2001 From: Stefan Boca <45266795+stefanboca@users.noreply.github.com> Date: Mon, 15 Jul 2024 13:58:34 -0700 Subject: [PATCH 261/323] feat(treesitter-context): which-key toggle (#4059) ## Description Add a which-key toggle for treesitter-context ## Screenshots ![image](https://github.com/user-attachments/assets/28c02607-a7e8-409c-a190-4fd2db85e8bb) ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- .../plugins/extras/ui/treesitter-context.lua | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/lua/lazyvim/plugins/extras/ui/treesitter-context.lua b/lua/lazyvim/plugins/extras/ui/treesitter-context.lua index a1f8d5f3..019977ed 100644 --- a/lua/lazyvim/plugins/extras/ui/treesitter-context.lua +++ b/lua/lazyvim/plugins/extras/ui/treesitter-context.lua @@ -1,21 +1,22 @@ -- Show context of the current function return { "nvim-treesitter/nvim-treesitter-context", - event = "LazyFile", - opts = { mode = "cursor", max_lines = 3 }, - keys = { - { - "ut", - function() - local tsc = require("treesitter-context") - tsc.toggle() - if LazyVim.inject.get_upvalue(tsc.toggle, "enabled") then - LazyVim.info("Enabled Treesitter Context", { title = "Option" }) + event = "VeryLazy", + opts = function() + local tsc = require("treesitter-context") + + LazyVim.toggle.map("ut", { + name = "Treesitter Context", + get = tsc.enabled, + set = function(state) + if state then + tsc.enable() else - LazyVim.warn("Disabled Treesitter Context", { title = "Option" }) + tsc.disable() end end, - desc = "Toggle Treesitter Context", - }, - }, + }) + + return { mode = "cursor", max_lines = 3 } + end, } From a1335e59e15ef55ee43dd30120da948bc0f293c3 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 15 Jul 2024 23:56:05 +0200 Subject: [PATCH 262/323] style: fix toggle desc --- lua/lazyvim/util/toggle.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/util/toggle.lua b/lua/lazyvim/util/toggle.lua index 99721e06..f7287a7b 100644 --- a/lua/lazyvim/util/toggle.lua +++ b/lua/lazyvim/util/toggle.lua @@ -20,7 +20,7 @@ function M.map(lhs, toggle) else LazyVim.warn("Disabled " .. toggle.name, { title = toggle.name }) end - end, { desc = "Toggle" .. toggle.name }) + end, { desc = "Toggle " .. toggle.name }) M.wk(lhs, toggle) end From 5339acacec0996968d64fdbaf9fe8187bfea1b47 Mon Sep 17 00:00:00 2001 From: Ben Puryear <54869170+Ben10164@users.noreply.github.com> Date: Tue, 16 Jul 2024 09:34:51 -0700 Subject: [PATCH 263/323] feat(R): added new which-key group for new install feature (#4078) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description A new feature was added to `r.nvim` that added a new key bind. This pr adds that key bind (and group in case more are added) to the current which-key config. (I also removed a comment that I made previously for increasing the width of the which-key window to fit the longer keybind descriptions, something that eventually was taken out of the previous PR long ago) ## Related Issue(s) None ## Screenshots Screenshot 2024-07-16 at 9 24 54 AM ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/lang/r.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/r.lua b/lua/lazyvim/plugins/extras/lang/r.lua index 96e618b3..f2c46041 100644 --- a/lua/lazyvim/plugins/extras/lang/r.lua +++ b/lua/lazyvim/plugins/extras/lang/r.lua @@ -19,14 +19,15 @@ return { vim.keymap.set("n", "", "RDSendLine", { buffer = true }) vim.keymap.set("v", "", "RSendSelection", { buffer = true }) - -- Increase the width of which-key to handle the longer r-nvim descriptions local wk = require("which-key") wk.add({ + buffer = true, { "a", group = "all" }, { "b", group = "between marks" }, { "c", group = "chunks" }, { "f", group = "functions" }, { "g", group = "goto" }, + { "i", group = "install" }, { "k", group = "knit" }, { "p", group = "paragraph" }, { "q", group = "quarto" }, From 1ceac326528f436dff4cdee952912021cbc33cc6 Mon Sep 17 00:00:00 2001 From: folke Date: Tue, 16 Jul 2024 16:35:40 +0000 Subject: [PATCH 264/323] chore(build): auto-generate docs --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 30cdbd12..cd12fa6e 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2024 July 15 +*LazyVim.txt* For Neovim Last change: 2024 July 16 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 150523b77b6e848c4135a97a5fd8f6f79a6f4443 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 16 Jul 2024 23:34:27 +0200 Subject: [PATCH 265/323] feat(toggle): make toggles callable. Fixes #4081 --- lua/lazyvim/util/toggle.lua | 56 ++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/lua/lazyvim/util/toggle.lua b/lua/lazyvim/util/toggle.lua index f7287a7b..a74034f4 100644 --- a/lua/lazyvim/util/toggle.lua +++ b/lua/lazyvim/util/toggle.lua @@ -5,17 +5,24 @@ local M = {} ---@field name string ---@field get fun():boolean ---@field set fun(state:boolean) ----@overload fun() -local T = {} -T.__index = T + +---@param toggle lazyvim.Toggle +---@return lazyvim.Toggle|fun():boolean +function M.wrap(toggle) + return setmetatable(toggle, { + __call = function(t) + t.set(not t.get()) + return t.get() + end, + }) +end ---@param lhs string ---@param toggle lazyvim.Toggle function M.map(lhs, toggle) + local t = M.wrap(toggle) LazyVim.safe_keymap_set("n", lhs, function() - local state = not toggle.get() - toggle.set(state) - if state then + if t() then LazyVim.info("Enabled " .. toggle.name, { title = toggle.name }) else LazyVim.warn("Disabled " .. toggle.name, { title = toggle.name }) @@ -41,8 +48,7 @@ function M.wk(lhs, toggle) }) end ----@type lazyvim.Toggle -M.treesitter = { +M.treesitter = M.wrap({ name = "Treesitter Highlight", get = function() return vim.b.ts_highlight @@ -54,12 +60,11 @@ M.treesitter = { vim.treesitter.stop() end end, -} +}) ---@param buf? boolean function M.format(buf) - ---@type lazyvim.Toggle - local ret = { + return M.wrap({ name = "Auto Format (" .. (buf and "Buffer" or "Global") .. ")", get = function() if not buf then @@ -70,8 +75,7 @@ function M.format(buf) set = function(state) LazyVim.format.enable(state, buf) end, - } - return ret + }) end ---@param opts? {values?: {[1]:any, [2]:any}, name?: string} @@ -80,8 +84,7 @@ function M.option(option, opts) local name = opts.name or option local on = opts.values and opts.values[2] or true local off = opts.values and opts.values[1] or false - ---@type lazyvim.Toggle - local ret = { + return M.wrap({ name = name, get = function() return vim.opt_local[option]:get() == on @@ -89,13 +92,11 @@ function M.option(option, opts) set = function(state) vim.opt_local[option] = state and on or off end, - } - return ret + }) end local nu = { number = true, relativenumber = true } ----@type lazyvim.Toggle -M.number = { +M.number = M.wrap({ name = "Line Numbers", get = function() return vim.opt_local.number:get() or vim.opt_local.relativenumber:get() @@ -110,19 +111,17 @@ M.number = { vim.opt_local.relativenumber = false end end, -} +}) ----@type lazyvim.Toggle -M.diagnostics = { +M.diagnostics = M.wrap({ name = "Diagnostics", get = function() return vim.diagnostic.is_enabled and vim.diagnostic.is_enabled() end, set = vim.diagnostic.enable, -} +}) ----@type lazyvim.Toggle -M.inlay_hints = { +M.inlay_hints = M.wrap({ name = "Inlay Hints", get = function() return vim.lsp.inlay_hint.is_enabled({ bufnr = 0 }) @@ -130,12 +129,11 @@ M.inlay_hints = { set = function(state) vim.lsp.inlay_hint.enable(state, { bufnr = 0 }) end, -} +}) ---@type {k:string, v:any}[] M._maximized = nil ----@type lazyvim.Toggle -M.maximize = { +M.maximize = M.wrap({ name = "Maximize", get = function() return M._maximized ~= nil @@ -170,7 +168,7 @@ M.maximize = { vim.cmd("wincmd =") end end, -} +}) setmetatable(M, { __call = function(m, ...) From 60b10deeb0635a8e54f2ef01504325179bbfd5c7 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 16 Jul 2024 23:54:23 +0200 Subject: [PATCH 266/323] style(toggle): types --- lua/lazyvim/util/toggle.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/util/toggle.lua b/lua/lazyvim/util/toggle.lua index a74034f4..46dc0bd3 100644 --- a/lua/lazyvim/util/toggle.lua +++ b/lua/lazyvim/util/toggle.lua @@ -6,15 +6,17 @@ local M = {} ---@field get fun():boolean ---@field set fun(state:boolean) +---@class lazyvim.Toggle.wrap: lazyvim.Toggle +---@operator call:boolean + ---@param toggle lazyvim.Toggle ----@return lazyvim.Toggle|fun():boolean function M.wrap(toggle) return setmetatable(toggle, { __call = function(t) t.set(not t.get()) return t.get() end, - }) + }) --[[@as lazyvim.Toggle.wrap]] end ---@param lhs string From bab54406dc312947e4e03bb728498503c09231ca Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 17 Jul 2024 12:40:56 +0200 Subject: [PATCH 267/323] feat(keymaps): proxy leader-w to ctrl-w --- lua/lazyvim/config/keymaps.lua | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lua/lazyvim/config/keymaps.lua b/lua/lazyvim/config/keymaps.lua index f568bdac..6468864b 100644 --- a/lua/lazyvim/config/keymaps.lua +++ b/lua/lazyvim/config/keymaps.lua @@ -174,13 +174,11 @@ map("t", "", "close", { desc = "Hide Terminal" }) map("t", "", "close", { desc = "which_key_ignore" }) -- windows -map("n", "ww", "p", { desc = "Other Window", remap = true }) -map("n", "wd", "c", { desc = "Delete Window", remap = true }) -map("n", "w-", "s", { desc = "Split Window Below", remap = true }) -map("n", "w|", "v", { desc = "Split Window Right", remap = true }) +map("n", "w", "", { desc = "Windows", remap = true }) map("n", "-", "s", { desc = "Split Window Below", remap = true }) map("n", "|", "v", { desc = "Split Window Right", remap = true }) -LazyVim.toggle.map("wm", LazyVim.toggle.maximize) +map("n", "d", "c", { desc = "Delete Window", remap = true }) +LazyVim.toggle.map("m", LazyVim.toggle.maximize) -- tabs map("n", "l", "tablast", { desc = "Last Tab" }) From 865bf15f1cf4d4f6a3eda6d7509f94a59752fb36 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 17 Jul 2024 12:42:29 +0200 Subject: [PATCH 268/323] feat(which-key): leader-w-space starts hydra mode for window mappings --- lua/lazyvim/plugins/editor.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 00401e61..a83cf189 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -195,6 +195,13 @@ return { end, desc = "Buffer Keymaps (which-key)", }, + { + "", + function() + require("which-key").show({ keys = "", loop = true }) + end, + desc = "Window Hydra Mode (which-key)", + }, }, config = function(_, opts) local wk = require("which-key") From 66bba787b83afdd85b5ee95aa589fbe9fbb95535 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 17 Jul 2024 12:42:55 +0200 Subject: [PATCH 269/323] feat(which-key): dynamic window mappings under leader-w --- lua/lazyvim/plugins/editor.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index a83cf189..1847bb65 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -177,7 +177,14 @@ return { { "q", group = "quit/session" }, { "s", group = "search" }, { "u", group = "ui", icon = { icon = "󰙵 ", color = "cyan" } }, - { "w", group = "windows" }, + { + "w", + group = "windows", + proxy = "", + expand = function() + return require("which-key.extras").expand.win() + end, + }, { "x", group = "diagnostics/quickfix", icon = { icon = "󱖫 ", color = "green" } }, { "[", group = "prev" }, { "]", group = "next" }, From 8d9f2ad97ee0d495135380975438ab8a8ae62b14 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 17 Jul 2024 12:43:12 +0200 Subject: [PATCH 270/323] feat(which-key): dynamic buffer mappings under leader-b --- lua/lazyvim/plugins/editor.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 1847bb65..39108009 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -169,7 +169,13 @@ return { { mode = { "n", "v" }, { "", group = "tabs" }, - { "b", group = "buffer" }, + { + "b", + group = "buffer", + expand = function() + return require("which-key.extras").expand.buf() + end, + }, { "c", group = "code" }, { "f", group = "file/find" }, { "g", group = "git" }, From fd2db9e5eee8f44e703994b303b535e8a38b59ca Mon Sep 17 00:00:00 2001 From: folke Date: Wed, 17 Jul 2024 10:44:14 +0000 Subject: [PATCH 271/323] chore(build): auto-generate docs --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index cd12fa6e..fc9d1472 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2024 July 16 +*LazyVim.txt* For Neovim Last change: 2024 July 17 ============================================================================== Table of Contents *LazyVim-table-of-contents* From d263cf5dd1daa3c6b0c07c6fe6cc21b1d39988bb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 17 Jul 2024 12:48:40 +0200 Subject: [PATCH 272/323] chore(main): release 12.31.0 (#4061) :robot: I have created a release *beep* *boop* --- ## [12.31.0](https://github.com/LazyVim/LazyVim/compare/v12.30.0...v12.31.0) (2024-07-17) ### Features * **keymaps:** proxy leader-w to ctrl-w ([bab5440](https://github.com/LazyVim/LazyVim/commit/bab54406dc312947e4e03bb728498503c09231ca)) * **R:** added new which-key group for new install feature ([#4078](https://github.com/LazyVim/LazyVim/issues/4078)) ([5339aca](https://github.com/LazyVim/LazyVim/commit/5339acacec0996968d64fdbaf9fe8187bfea1b47)) * **toggle:** make toggles callable. Fixes [#4081](https://github.com/LazyVim/LazyVim/issues/4081) ([150523b](https://github.com/LazyVim/LazyVim/commit/150523b77b6e848c4135a97a5fd8f6f79a6f4443)) * **treesitter-context:** which-key toggle ([#4059](https://github.com/LazyVim/LazyVim/issues/4059)) ([ab01350](https://github.com/LazyVim/LazyVim/commit/ab0135093bc18ccf82325bc8ee14c25230a71786)) * **which-key:** dynamic buffer mappings under leader-b ([8d9f2ad](https://github.com/LazyVim/LazyVim/commit/8d9f2ad97ee0d495135380975438ab8a8ae62b14)) * **which-key:** dynamic window mappings under leader-w ([66bba78](https://github.com/LazyVim/LazyVim/commit/66bba787b83afdd85b5ee95aa589fbe9fbb95535)) * **which-key:** leader-w-space starts hydra mode for window mappings ([865bf15](https://github.com/LazyVim/LazyVim/commit/865bf15f1cf4d4f6a3eda6d7509f94a59752fb36)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/.release-please-manifest.json | 2 +- CHANGELOG.md | 13 +++++++++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index 1abbe376..99686455 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "12.30.0" + ".": "12.31.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index f7f74112..bf1c921a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## [12.31.0](https://github.com/LazyVim/LazyVim/compare/v12.30.0...v12.31.0) (2024-07-17) + + +### Features + +* **keymaps:** proxy leader-w to ctrl-w ([bab5440](https://github.com/LazyVim/LazyVim/commit/bab54406dc312947e4e03bb728498503c09231ca)) +* **R:** added new which-key group for new install feature ([#4078](https://github.com/LazyVim/LazyVim/issues/4078)) ([5339aca](https://github.com/LazyVim/LazyVim/commit/5339acacec0996968d64fdbaf9fe8187bfea1b47)) +* **toggle:** make toggles callable. Fixes [#4081](https://github.com/LazyVim/LazyVim/issues/4081) ([150523b](https://github.com/LazyVim/LazyVim/commit/150523b77b6e848c4135a97a5fd8f6f79a6f4443)) +* **treesitter-context:** which-key toggle ([#4059](https://github.com/LazyVim/LazyVim/issues/4059)) ([ab01350](https://github.com/LazyVim/LazyVim/commit/ab0135093bc18ccf82325bc8ee14c25230a71786)) +* **which-key:** dynamic buffer mappings under leader-b ([8d9f2ad](https://github.com/LazyVim/LazyVim/commit/8d9f2ad97ee0d495135380975438ab8a8ae62b14)) +* **which-key:** dynamic window mappings under leader-w ([66bba78](https://github.com/LazyVim/LazyVim/commit/66bba787b83afdd85b5ee95aa589fbe9fbb95535)) +* **which-key:** leader-w-space starts hydra mode for window mappings ([865bf15](https://github.com/LazyVim/LazyVim/commit/865bf15f1cf4d4f6a3eda6d7509f94a59752fb36)) + ## [12.30.0](https://github.com/LazyVim/LazyVim/compare/v12.29.2...v12.30.0) (2024-07-15) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 08029fc9..abe2ff6e 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "12.30.0" -- x-release-please-version +M.version = "12.31.0" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From c1b76ee235a2cccff6370ecfca57bdacd5fe6258 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 17 Jul 2024 15:06:45 +0200 Subject: [PATCH 273/323] feat(toggle): move toggle notifs to toggle function --- lua/lazyvim/util/toggle.lua | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lua/lazyvim/util/toggle.lua b/lua/lazyvim/util/toggle.lua index 46dc0bd3..c8027666 100644 --- a/lua/lazyvim/util/toggle.lua +++ b/lua/lazyvim/util/toggle.lua @@ -12,9 +12,15 @@ local M = {} ---@param toggle lazyvim.Toggle function M.wrap(toggle) return setmetatable(toggle, { - __call = function(t) - t.set(not t.get()) - return t.get() + __call = function() + toggle.set(not toggle.get()) + local state = toggle.get() + if state then + LazyVim.info("Enabled " .. toggle.name, { title = toggle.name }) + else + LazyVim.warn("Disabled " .. toggle.name, { title = toggle.name }) + end + return state end, }) --[[@as lazyvim.Toggle.wrap]] end @@ -24,11 +30,7 @@ end function M.map(lhs, toggle) local t = M.wrap(toggle) LazyVim.safe_keymap_set("n", lhs, function() - if t() then - LazyVim.info("Enabled " .. toggle.name, { title = toggle.name }) - else - LazyVim.warn("Disabled " .. toggle.name, { title = toggle.name }) - end + t() end, { desc = "Toggle " .. toggle.name }) M.wk(lhs, toggle) end From b1a47405b9fa5eb9f5222876e81be73206b80792 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 18 Jul 2024 00:21:19 +0200 Subject: [PATCH 274/323] feat(edgy): added support for grug-far.nvim --- lua/lazyvim/plugins/extras/ui/edgy.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/lazyvim/plugins/extras/ui/edgy.lua b/lua/lazyvim/plugins/extras/ui/edgy.lua index cb2c7358..f63e31ad 100644 --- a/lua/lazyvim/plugins/extras/ui/edgy.lua +++ b/lua/lazyvim/plugins/extras/ui/edgy.lua @@ -56,6 +56,9 @@ return { { title = "Neotest Summary", ft = "neotest-summary" }, -- "neo-tree", }, + right = { + { title = "Grug Far", ft = "grug-far", size = { width = 0.4 } }, + }, keys = { -- increase width [""] = function(win) From d6561fd27c17806ca972cbfc18573ca81d13e346 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 18 Jul 2024 00:41:54 +0200 Subject: [PATCH 275/323] fix(autcmds): desc for close_with_q --- lua/lazyvim/config/autocmds.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/config/autocmds.lua b/lua/lazyvim/config/autocmds.lua index f9a83c82..1440d069 100644 --- a/lua/lazyvim/config/autocmds.lua +++ b/lua/lazyvim/config/autocmds.lua @@ -71,7 +71,11 @@ vim.api.nvim_create_autocmd("FileType", { }, callback = function(event) vim.bo[event.buf].buflisted = false - vim.keymap.set("n", "q", "close", { buffer = event.buf, silent = true }) + vim.keymap.set("n", "q", "close", { + buffer = event.buf, + silent = true, + desc = "Quit buffer", + }) end, }) From b5290fd92935d2e96fa2249cfd09bdd853972869 Mon Sep 17 00:00:00 2001 From: dotfrag <17456867+dotfrag@users.noreply.github.com> Date: Thu, 18 Jul 2024 08:10:22 +0300 Subject: [PATCH 276/323] feat(terminal): clear search highlight when opening a terminal (#4090) ## Description Often times when opening a terminal or lazygit when a search is active, words in the terminal are highlighted. In my opinion this is rarely, if not never intended. This attempts to fixes this behavior. The code of `terminal.lua` is a bit beyond me, but I believe I have added it to the right place. ## Related Issue(s) N/A. ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/util/terminal.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/lazyvim/util/terminal.lua b/lua/lazyvim/util/terminal.lua index 598f8ffc..87f8553b 100644 --- a/lua/lazyvim/util/terminal.lua +++ b/lua/lazyvim/util/terminal.lua @@ -87,6 +87,8 @@ function M.open(cmd, opts) vim.cmd.startinsert() end, }) + + vim.cmd("noh") end return terminals[termkey] From 87ef93e8a015b4737c5f269f350a790b4f61c907 Mon Sep 17 00:00:00 2001 From: folke Date: Thu, 18 Jul 2024 05:11:12 +0000 Subject: [PATCH 277/323] chore(build): auto-generate docs --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index fc9d1472..fcd74ffc 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2024 July 17 +*LazyVim.txt* For Neovim Last change: 2024 July 18 ============================================================================== Table of Contents *LazyVim-table-of-contents* From d2483f19cee5234db1e010e6560d9aa9bb60bb30 Mon Sep 17 00:00:00 2001 From: Jeremy Pridemore Date: Wed, 17 Jul 2024 23:21:50 -0600 Subject: [PATCH 278/323] feat(lualine): allow for trouble_lualine to be overriden on buffer (#4096) ## Description Right now there is a default `vim.g.trouble_lualine` being set to `true`, and only that variable is being checked when deciding if the trouble output is being appended to the `lualine_c` for the lualine plugin. This is normally nice in code files, where you can get output like `packages/src/index.ts > myFunction` but in some filetypes, the user may not wish for this. In particular, I found if you have files with the `markdown` type that include long headers, then you can easily lose the file name by it trying to include the headers in this location. Considering that one of the `CONTRIBUTING.md` guidelines is `Ensure all configurations are overridable by the user, using Lazy's specs.`, I figured that allowing this to be overrideable at the user's discretion could be a valuable feature. This would allow the user to override this on file type by including an autocmd like this in their `lua/config/autocmds.lua` or equivalent: ```lua -- disable trouble symbols in lualine in text filetypes vim.api.nvim_create_autocmd("FileType", { group = vim.api.nvim_create_augroup("disable_trouble_lualine", { clear = true }), pattern = { "text", "plaintex", "typst", "gitcommit", "markdown" }, callback = function() vim.b.trouble_lualine = false end, }) ``` ## Related Issue(s) None ## Screenshots ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --------- Co-authored-by: jpridemore-allegion --- lua/lazyvim/plugins/ui.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index 14a77ce4..6455658d 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -198,7 +198,12 @@ return { } -- do not add trouble symbols if aerial is enabled - if vim.g.trouble_lualine and LazyVim.has("trouble.nvim") then + -- And allow it to be overriden for some buffer types (see autocmds) + if + vim.g.trouble_luline_enabed ~= false + and vim.b.trouble_lualine_enabled ~= false + and LazyVim.has("trouble.nvim") + then local trouble = require("trouble") local symbols = trouble.statusline and trouble.statusline({ From 4ac249beaae3462d606128ca21db79cb85a8c65b Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 18 Jul 2024 09:30:56 +0200 Subject: [PATCH 279/323] fix(ui): typo --- lua/lazyvim/plugins/ui.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index 6455658d..7b43551a 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -200,7 +200,7 @@ return { -- do not add trouble symbols if aerial is enabled -- And allow it to be overriden for some buffer types (see autocmds) if - vim.g.trouble_luline_enabed ~= false + vim.g.trouble_lualine_enabed ~= false and vim.b.trouble_lualine_enabled ~= false and LazyVim.has("trouble.nvim") then From b8bdebe5be7eba91db23e43575fc1226075f6a56 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 18 Jul 2024 10:42:02 +0200 Subject: [PATCH 280/323] fix(ui): another typo --- lua/lazyvim/plugins/ui.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index 7b43551a..bbffe75f 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -200,7 +200,7 @@ return { -- do not add trouble symbols if aerial is enabled -- And allow it to be overriden for some buffer types (see autocmds) if - vim.g.trouble_lualine_enabed ~= false + vim.g.trouble_lualine_enabled ~= false and vim.b.trouble_lualine_enabled ~= false and LazyVim.has("trouble.nvim") then From 0daa957b3c8e672c9608bda7cd737cd8090adf80 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 18 Jul 2024 10:48:31 +0200 Subject: [PATCH 281/323] chore(main): release 12.32.0 (#4086) :robot: I have created a release *beep* *boop* --- ## [12.32.0](https://github.com/LazyVim/LazyVim/compare/v12.31.0...v12.32.0) (2024-07-18) ### Features * **edgy:** added support for grug-far.nvim ([b1a4740](https://github.com/LazyVim/LazyVim/commit/b1a47405b9fa5eb9f5222876e81be73206b80792)) * **terminal:** clear search highlight when opening a terminal ([#4090](https://github.com/LazyVim/LazyVim/issues/4090)) ([b5290fd](https://github.com/LazyVim/LazyVim/commit/b5290fd92935d2e96fa2249cfd09bdd853972869)) * **toggle:** move toggle notifs to toggle function ([c1b76ee](https://github.com/LazyVim/LazyVim/commit/c1b76ee235a2cccff6370ecfca57bdacd5fe6258)) ### Bug Fixes * **autcmds:** desc for close_with_q ([d6561fd](https://github.com/LazyVim/LazyVim/commit/d6561fd27c17806ca972cbfc18573ca81d13e346)) * **ui:** another typo ([b8bdebe](https://github.com/LazyVim/LazyVim/commit/b8bdebe5be7eba91db23e43575fc1226075f6a56)) * **ui:** typo ([4ac249b](https://github.com/LazyVim/LazyVim/commit/4ac249beaae3462d606128ca21db79cb85a8c65b)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/.release-please-manifest.json | 2 +- CHANGELOG.md | 16 ++++++++++++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index 99686455..9f92a4d3 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "12.31.0" + ".": "12.32.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index bf1c921a..b148a091 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## [12.32.0](https://github.com/LazyVim/LazyVim/compare/v12.31.0...v12.32.0) (2024-07-18) + + +### Features + +* **edgy:** added support for grug-far.nvim ([b1a4740](https://github.com/LazyVim/LazyVim/commit/b1a47405b9fa5eb9f5222876e81be73206b80792)) +* **terminal:** clear search highlight when opening a terminal ([#4090](https://github.com/LazyVim/LazyVim/issues/4090)) ([b5290fd](https://github.com/LazyVim/LazyVim/commit/b5290fd92935d2e96fa2249cfd09bdd853972869)) +* **toggle:** move toggle notifs to toggle function ([c1b76ee](https://github.com/LazyVim/LazyVim/commit/c1b76ee235a2cccff6370ecfca57bdacd5fe6258)) + + +### Bug Fixes + +* **autcmds:** desc for close_with_q ([d6561fd](https://github.com/LazyVim/LazyVim/commit/d6561fd27c17806ca972cbfc18573ca81d13e346)) +* **ui:** another typo ([b8bdebe](https://github.com/LazyVim/LazyVim/commit/b8bdebe5be7eba91db23e43575fc1226075f6a56)) +* **ui:** typo ([4ac249b](https://github.com/LazyVim/LazyVim/commit/4ac249beaae3462d606128ca21db79cb85a8c65b)) + ## [12.31.0](https://github.com/LazyVim/LazyVim/compare/v12.30.0...v12.31.0) (2024-07-17) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index abe2ff6e..a95f519f 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "12.31.0" -- x-release-please-version +M.version = "12.32.0" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From f9fdb356f2362e5ae4ef490944b1957b49dc6680 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 18 Jul 2024 15:45:53 +0200 Subject: [PATCH 282/323] fix(ui): trouble lualine component --- lua/lazyvim/config/options.lua | 1 + lua/lazyvim/plugins/ui.lua | 27 ++++++++++++--------------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/lua/lazyvim/config/options.lua b/lua/lazyvim/config/options.lua index 5c66966a..a8d512fc 100644 --- a/lua/lazyvim/config/options.lua +++ b/lua/lazyvim/config/options.lua @@ -47,6 +47,7 @@ vim.g.deprecation_warnings = false vim.g.bigfile_size = 1024 * 1024 * 1.5 -- 1.5 MB -- Show the current document symbols location from Trouble in lualine +-- You can disable this for a buffer by setting `vim.b.trouble_lualine = false` vim.g.trouble_lualine = true local opt = vim.opt diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index bbffe75f..ed17182d 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -199,24 +199,21 @@ return { -- do not add trouble symbols if aerial is enabled -- And allow it to be overriden for some buffer types (see autocmds) - if - vim.g.trouble_lualine_enabled ~= false - and vim.b.trouble_lualine_enabled ~= false - and LazyVim.has("trouble.nvim") - then + if vim.g.trouble_lualine and LazyVim.has("trouble.nvim") then local trouble = require("trouble") - local symbols = trouble.statusline - and trouble.statusline({ - mode = "symbols", - groups = {}, - title = false, - filter = { range = true }, - format = "{kind_icon}{symbol.name:Normal}", - hl_group = "lualine_c_normal", - }) + local symbols = trouble.statusline({ + mode = "symbols", + groups = {}, + title = false, + filter = { range = true }, + format = "{kind_icon}{symbol.name:Normal}", + hl_group = "lualine_c_normal", + }) table.insert(opts.sections.lualine_c, { symbols and symbols.get, - cond = symbols and symbols.has, + cond = function() + return vim.b.trouble_lualine ~= false and symbols.has() + end, }) end From a219e105b0e86316edfedb57f1fa267a764eab13 Mon Sep 17 00:00:00 2001 From: Ben Puryear <54869170+Ben10164@users.noreply.github.com> Date: Fri, 19 Jul 2024 00:33:49 -0700 Subject: [PATCH 283/323] feat(lang): add OCaml (#4079) ## Description Adds an extra that adds language support for ocaml. Adds LSP and completions. Fairly simple/small config. ## Related Issue(s) None ## Screenshots lsp ocaml ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/lang/ocaml.lua | 39 +++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 lua/lazyvim/plugins/extras/lang/ocaml.lua diff --git a/lua/lazyvim/plugins/extras/lang/ocaml.lua b/lua/lazyvim/plugins/extras/lang/ocaml.lua new file mode 100644 index 00000000..d4485856 --- /dev/null +++ b/lua/lazyvim/plugins/extras/lang/ocaml.lua @@ -0,0 +1,39 @@ +return { + recommended = function() + return LazyVim.extras.wants({ + ft = { "ml", "mli", "cmi", "cmo", "cmx", "cma", "cmxa", "cmxs", "cmt", "cmti", "opam" }, + root = { "merlin.opam", "dune-project" }, + }) + end, + { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + if type(opts.ensure_installed) == "table" then + vim.list_extend(opts.ensure_installed, { "ocaml" }) + end + end, + }, + { + "neovim/nvim-lspconfig", + opts = { + servers = { + ocamllsp = { + get_language_id = function(_, ftype) + return language_id_of[ftype] + end, + root_dir = function(fname) + return require("lspconfig.util").root_pattern( + "*.opam", + "esy.json", + "package.json", + ".git", + "dune-project", + "dune-workspace", + "*.ml" + )(fname) + end, + }, + }, + }, + }, +} From 5795be3c195699719d135c45a96825b09719268b Mon Sep 17 00:00:00 2001 From: folke Date: Fri, 19 Jul 2024 07:34:55 +0000 Subject: [PATCH 284/323] chore(build): auto-generate docs --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index fcd74ffc..be7d61e6 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2024 July 18 +*LazyVim.txt* For Neovim Last change: 2024 July 19 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 3e29fdf478383034c48477dd04fd433a7c9327ee Mon Sep 17 00:00:00 2001 From: Ben Puryear <54869170+Ben10164@users.noreply.github.com> Date: Fri, 19 Jul 2024 00:38:55 -0700 Subject: [PATCH 285/323] feat(lang): add Lean 4 support (#4080) ## Description Adds language support for lean, a popular proof assistant and theorem prover. ## Related Issue(s) None ## Screenshots Language Server lsp Lean Execution (infobox on the right) goals Keymaps keymaps Many More Commands lots of commands ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --------- Co-authored-by: Folke Lemaitre --- lua/lazyvim/plugins/extras/lang/lean.lua | 125 +++++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 lua/lazyvim/plugins/extras/lang/lean.lua diff --git a/lua/lazyvim/plugins/extras/lang/lean.lua b/lua/lazyvim/plugins/extras/lang/lean.lua new file mode 100644 index 00000000..9ac37f7d --- /dev/null +++ b/lua/lazyvim/plugins/extras/lang/lean.lua @@ -0,0 +1,125 @@ +return { + recommended = function() + return LazyVim.extras.wants({ + ft = { "lean" }, + root = { "lean-toolchain" }, + }) + end, + "Julian/lean.nvim", + event = { "BufReadPre *.lean", "BufNewFile *.lean" }, + dependencies = { + "nvim-lua/plenary.nvim", + }, + + -- see details below for full configuration options + opts = { + -- Enable the Lean language server(s)? + -- + -- false to disable, otherwise should be a table of options to pass to `leanls` + -- + -- See https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#leanls for details. + -- In particular ensure you have followed instructions setting up a callback + -- for `LspAttach` which sets your key bindings! + lsp = { + init_options = { + -- See Lean.Lsp.InitializationOptions for details and further options. + + -- Time (in milliseconds) which must pass since latest edit until elaboration begins. + -- Lower values may make editing feel faster at the cost of higher CPU usage. + -- Note that lean.nvim changes the Lean default for this value! + editDelay = 0, + + -- Whether to signal that widgets are supported. + hasWidgets = true, + }, + }, + + ft = { + -- A list of patterns which will be used to protect any matching + -- Lean file paths from being accidentally modified (by marking the + -- buffer as `nomodifiable`). + nomodifiable = { + -- by default, this list includes the Lean standard libraries, + -- as well as files within dependency directories (e.g. `_target`) + -- Set this to an empty table to disable. + }, + }, + + -- Abbreviation support + abbreviations = { + -- Enable expanding of unicode abbreviations? + enable = true, + -- additional abbreviations: + extra = { + -- Add a \wknight abbreviation to insert ♘ + -- + -- Note that the backslash is implied, and that you of + -- course may also use a snippet engine directly to do + -- this if so desired. + wknight = "♘", + }, + -- Change if you don't like the backslash + -- (comma is a popular choice on French keyboards) + leader = "\\", + }, + + -- Enable suggested mappings? + -- + -- false by default, true to enable + mappings = true, + + -- Infoview support + infoview = { + -- Automatically open an infoview on entering a Lean buffer? + -- Should be a function that will be called anytime a new Lean file + -- is opened. Return true to open an infoview, otherwise false. + -- Setting this to `true` is the same as `function() return true end`, + -- i.e. autoopen for any Lean file, or setting it to `false` is the + -- same as `function() return false end`, i.e. never autoopen. + autoopen = true, + + -- Set infoview windows' starting dimensions. + -- Windows are opened horizontally or vertically depending on spacing. + width = 50, + height = 20, + + -- Put the infoview on the top or bottom when horizontal? + -- top | bottom + horizontal_position = "bottom", + + -- Always open the infoview window in a separate tabpage. + -- Might be useful if you are using a screen reader and don't want too + -- many dynamic updates in the terminal at the same time. + -- Note that `height` and `width` will be ignored in this case. + separate_tab = false, + + -- Show indicators for pin locations when entering an infoview window? + -- always | never | auto (= only when there are multiple pins) + indicators = "auto", + }, + + -- Progress bar support + progress_bars = { + -- Enable the progress bars? + enable = true, + -- What character should be used for the bars? + character = "│", + -- Use a different priority for the signs + priority = 10, + }, + + -- Redirect Lean's stderr messages somehwere (to a buffer by default) + stderr = { + enable = true, + -- height of the window + height = 5, + -- a callback which will be called with (multi-line) stderr output + -- e.g., use: + -- on_lines = function(lines) vim.notify(lines) end + -- if you want to redirect stderr to `vim.notify`. + -- The default implementation will redirect to a dedicated stderr + -- window. + on_lines = nil, + }, + }, +} From 783949810855556dd12ed2685e62fb37a4c9504d Mon Sep 17 00:00:00 2001 From: Kevin Robayna Date: Fri, 19 Jul 2024 10:09:57 +0100 Subject: [PATCH 286/323] feat(extras): improve ruby extra by letting user chose (#3652) ## What is this PR for? Shopify started working on its own LSP (https://github.com/Shopify/ruby-lsp) and it performs way better than Solargraph which has a lot of limitations. This paired with sorbet gives better IntelliSense when navigating the code. This PR follows the same approach as Python and lets the user configure through vim.g options the lsp and formatter for ruby, without overriding any configuration. ## Does this PR fix an existing issue? One caveat though is that RubyLsp does not work very well with NeoVim < 0.10 https://github.com/Shopify/ruby-lsp/blob/main/EDITORS.md#neovim ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/lang/ruby.lua | 43 +++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/ruby.lua b/lua/lazyvim/plugins/extras/lang/ruby.lua index c70e645d..6eb4fce5 100644 --- a/lua/lazyvim/plugins/extras/lang/ruby.lua +++ b/lua/lazyvim/plugins/extras/lang/ruby.lua @@ -1,3 +1,17 @@ +if lazyvim_docs then + -- LSP Server to use for Ruby. + -- Set to "solargraph" to use solargraph instead of ruby_lsp. + vim.g.lazyvim_ruby_lsp = "ruby_lsp" + vim.g.lazyvim_ruby_formatter = "rubocop" +end + +local lsp = vim.g.lazyvim_ruby_lsp or "ruby_lsp" +if vim.fn.has("nvim-0.10") == 0 then + -- ruby_lsp does not work well with Neovim < 0.10 + lsp = vim.g.lazyvim_ruby_lsp or "solargraph" +end +local formatter = vim.g.lazyvim_ruby_formatter or "rubocop" + return { recommended = function() return LazyVim.extras.wants({ @@ -11,12 +25,29 @@ return { }, { "neovim/nvim-lspconfig", + ---@class PluginLspOpts opts = { + ---@type lspconfig.options servers = { - solargraph = {}, + ruby_lsp = { + enabled = lsp == "ruby_lsp", + }, + solargraph = { + enabled = lsp == "solargraph", + }, + rubocop = { + enabled = formatter == "rubocop", + }, + standardrb = { + enabled = formatter == "standardrb", + }, }, }, }, + { + "williamboman/mason.nvim", + opts = { ensure_installed = { "erb-formatter", "erb-lint" } }, + }, { "mfussenegger/nvim-dap", optional = true, @@ -27,6 +58,16 @@ return { end, }, }, + { + "stevearc/conform.nvim", + optional = true, + opts = { + formatters_by_ft = { + ruby = { formatter }, + eruby = { "erb-format" }, + }, + }, + }, { "nvim-neotest/neotest", optional = true, From 64afb5f00718cb2735bd68577dfac357be790cb0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 19 Jul 2024 11:50:05 +0200 Subject: [PATCH 287/323] chore(main): release 12.33.0 (#4102) :robot: I have created a release *beep* *boop* --- ## [12.33.0](https://github.com/LazyVim/LazyVim/compare/v12.32.0...v12.33.0) (2024-07-19) ### Features * **extras:** improve ruby extra by letting user chose ([#3652](https://github.com/LazyVim/LazyVim/issues/3652)) ([7839498](https://github.com/LazyVim/LazyVim/commit/783949810855556dd12ed2685e62fb37a4c9504d)) * **lang:** add Lean 4 support ([#4080](https://github.com/LazyVim/LazyVim/issues/4080)) ([3e29fdf](https://github.com/LazyVim/LazyVim/commit/3e29fdf478383034c48477dd04fd433a7c9327ee)) * **lang:** add OCaml ([#4079](https://github.com/LazyVim/LazyVim/issues/4079)) ([a219e10](https://github.com/LazyVim/LazyVim/commit/a219e105b0e86316edfedb57f1fa267a764eab13)) ### Bug Fixes * **ui:** trouble lualine component ([f9fdb35](https://github.com/LazyVim/LazyVim/commit/f9fdb356f2362e5ae4ef490944b1957b49dc6680)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/.release-please-manifest.json | 2 +- CHANGELOG.md | 14 ++++++++++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index 9f92a4d3..98ca8693 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "12.32.0" + ".": "12.33.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index b148a091..48c3581f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## [12.33.0](https://github.com/LazyVim/LazyVim/compare/v12.32.0...v12.33.0) (2024-07-19) + + +### Features + +* **extras:** improve ruby extra by letting user chose ([#3652](https://github.com/LazyVim/LazyVim/issues/3652)) ([7839498](https://github.com/LazyVim/LazyVim/commit/783949810855556dd12ed2685e62fb37a4c9504d)) +* **lang:** add Lean 4 support ([#4080](https://github.com/LazyVim/LazyVim/issues/4080)) ([3e29fdf](https://github.com/LazyVim/LazyVim/commit/3e29fdf478383034c48477dd04fd433a7c9327ee)) +* **lang:** add OCaml ([#4079](https://github.com/LazyVim/LazyVim/issues/4079)) ([a219e10](https://github.com/LazyVim/LazyVim/commit/a219e105b0e86316edfedb57f1fa267a764eab13)) + + +### Bug Fixes + +* **ui:** trouble lualine component ([f9fdb35](https://github.com/LazyVim/LazyVim/commit/f9fdb356f2362e5ae4ef490944b1957b49dc6680)) + ## [12.32.0](https://github.com/LazyVim/LazyVim/compare/v12.31.0...v12.32.0) (2024-07-18) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index a95f519f..4d154371 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "12.32.0" -- x-release-please-version +M.version = "12.33.0" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From 578f06e1401defbbc0a82f9ff1fb505564d038cf Mon Sep 17 00:00:00 2001 From: abeldekat <58370433+abeldekat@users.noreply.github.com> Date: Sat, 20 Jul 2024 11:48:11 +0200 Subject: [PATCH 288/323] perf(core): defer clipboard because xsel and pbcopy can be slow (#4120) ## Description See [this](https://github.com/LazyVim/LazyVim/discussions/4112) discussion TLDR: Startup time performance is affected quite significantly when the clipboard provider is `xsel`(linux) or `pbcopy`(macos). I expect an improvement in these cases, especially on older pc's. This PR resets `vim.opt.clipboard` after the `options` are loaded. Then, on `VeryLazy`, the setting is restored. I also tested with `yanky`. Relevant prints: 1. Before resetting `vim.opt.clipboard` in `init`, `vim.print(vim.opt.clipboard)` yields a table which will be captured: ```lua --- fields _name = "clipboard", _value = "unnamedplus", --- more fields ``` 2. Set `vim.opt.clipboard = ""` and `vim.print(vim.opt.clipboard)`, also yields a table: ```lua --- fields _name = "clipboard", _value = "", --- more fields ``` ## Related Issue(s) ## Screenshots ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. Co-authored-by: abeldekat --- lua/lazyvim/config/init.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 4d154371..90051817 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -161,6 +161,7 @@ end ---@type LazyVimOptions local options +local lazy_clipboard ---@param opts? LazyVimOptions function M.setup(opts) @@ -181,6 +182,9 @@ function M.setup(opts) M.load("autocmds") end M.load("keymaps") + if lazy_clipboard ~= nil then + vim.opt.clipboard = lazy_clipboard + end LazyVim.format.setup() LazyVim.news.setup() @@ -285,6 +289,9 @@ function M.init() -- this is needed to make sure options will be correctly applied -- after installing missing plugins M.load("options") + -- defer built-in clipboard handling: "xsel" and "pbcopy" can be slow + lazy_clipboard = vim.opt.clipboard + vim.opt.clipboard = "" if vim.g.deprecation_warnings == false then vim.deprecate = function() end From 6f91b406ddf2b298efe43f6467ca0a9103881a88 Mon Sep 17 00:00:00 2001 From: folke Date: Sat, 20 Jul 2024 09:49:07 +0000 Subject: [PATCH 289/323] chore(build): auto-generate docs --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index be7d61e6..9a318334 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2024 July 19 +*LazyVim.txt* For Neovim Last change: 2024 July 20 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 3d1f961232e0d286896e8c3026c9e2dbb3c63808 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 20 Jul 2024 17:04:01 +0200 Subject: [PATCH 290/323] refactor: which-key mappings --- lua/lazyvim/plugins/editor.lua | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 39108009..f893b355 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -169,13 +169,6 @@ return { { mode = { "n", "v" }, { "", group = "tabs" }, - { - "b", - group = "buffer", - expand = function() - return require("which-key.extras").expand.buf() - end, - }, { "c", group = "code" }, { "f", group = "file/find" }, { "g", group = "git" }, @@ -183,6 +176,19 @@ return { { "q", group = "quit/session" }, { "s", group = "search" }, { "u", group = "ui", icon = { icon = "󰙵 ", color = "cyan" } }, + { "x", group = "diagnostics/quickfix", icon = { icon = "󱖫 ", color = "green" } }, + { "[", group = "prev" }, + { "]", group = "next" }, + { "g", group = "goto" }, + { "gs", group = "surround" }, + { "z", group = "fold" }, + { + "b", + group = "buffer", + expand = function() + return require("which-key.extras").expand.buf() + end, + }, { "w", group = "windows", @@ -191,12 +197,8 @@ return { return require("which-key.extras").expand.win() end, }, - { "x", group = "diagnostics/quickfix", icon = { icon = "󱖫 ", color = "green" } }, - { "[", group = "prev" }, - { "]", group = "next" }, - { "g", group = "goto" }, - { "gs", group = "surround" }, - { "z", group = "fold" }, + -- better descriptions + { "gx", desc = "Open with system app" }, }, }, }, From eed91a3e4c1521dd839d1a8bc09bdd98ac2fb874 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 20 Jul 2024 17:14:07 +0200 Subject: [PATCH 291/323] fix(conform): changes for new conform.nvim config --- lua/lazyvim/plugins/formatting.lua | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lua/lazyvim/plugins/formatting.lua b/lua/lazyvim/plugins/formatting.lua index f4160b4d..ae32c0ef 100644 --- a/lua/lazyvim/plugins/formatting.lua +++ b/lua/lazyvim/plugins/formatting.lua @@ -1,6 +1,6 @@ local M = {} ----@param opts ConformOpts +---@param opts conform.setupOpts function M.setup(_, opts) for _, key in ipairs({ "format_on_save", "format_after_save" }) do if opts[key] then @@ -10,6 +10,10 @@ function M.setup(_, opts) opts[key] = nil end end + ---@diagnostic disable-next-line: undefined-field + if opts.format then + LazyVim.warn("**conform.nvim** `opts.format` is deprecated. Please use `opts.default_format_opts` instead.") + end require("conform").setup(opts) end @@ -37,8 +41,7 @@ return { priority = 100, primary = true, format = function(buf) - local opts = LazyVim.opts("conform.nvim") - require("conform").format(LazyVim.merge({}, opts.format, { bufnr = buf })) + require("conform").format({ bufnr = buf }) end, sources = function(buf) local ret = require("conform").list_formatters(buf) @@ -59,16 +62,14 @@ return { "Please refer to the docs at https://www.lazyvim.org/plugins/formatting", }, { title = "LazyVim" }) end - ---@class ConformOpts + ---@type conform.setupOpts local opts = { - -- LazyVim will use these options when formatting with the conform.nvim formatter - format = { + default_format_opts = { timeout_ms = 3000, async = false, -- not recommended to change quiet = false, -- not recommended to change lsp_format = "fallback", -- not recommended to change }, - ---@type table formatters_by_ft = { lua = { "stylua" }, fish = { "fish_indent" }, From 0d561a3226b46f6a44c4f2c9be2288f3b52cc351 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 20 Jul 2024 21:39:39 +0200 Subject: [PATCH 292/323] feat(editor): replace nvim-spectre with grug-far.nvim (#4099) ## Description I'm considering to replace [nvim-spectre](https://github.com/nvim-pack/nvim-spectre) with [grug-far.nvim](https://github.com/MagicDuck/grug-far.nvim). It has a better ui and I like the workflow better. I won't merge this right away. I'm mostly looking for feedback on whether this would be a good thing and whether the defaults option I've added seem ok. ## Related Issue(s) ## Screenshots ![image](https://github.com/user-attachments/assets/bc44e35b-e033-4769-ad40-cdfe9e3482f4) ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- NEWS.md | 3 +++ lua/lazyvim/config/autocmds.lua | 1 + lua/lazyvim/plugins/editor.lua | 24 ++++++++++++++----- .../plugins/extras/ui/mini-animate.lua | 7 ++++++ 4 files changed, 29 insertions(+), 6 deletions(-) diff --git a/NEWS.md b/NEWS.md index 3abd43b7..1abf2ec8 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,9 @@ ## 12.x +- [nvim-spectre](https://github.com/nvim-pack/nvim-spectre) has been removed in favor of [grug-far.nvim](https://github.com/MagicDuck/grug-far.nvim). + **grug-far.nvim** has a great UI and feels more intuitive to use. + - This **news** is now also available on the website at [https://www.lazyvim.org/news](https://www.lazyvim.org/news) - **prettier** extra now works for all prettier supported filetypes diff --git a/lua/lazyvim/config/autocmds.lua b/lua/lazyvim/config/autocmds.lua index 1440d069..edb392db 100644 --- a/lua/lazyvim/config/autocmds.lua +++ b/lua/lazyvim/config/autocmds.lua @@ -55,6 +55,7 @@ vim.api.nvim_create_autocmd("FileType", { group = augroup("close_with_q"), pattern = { "PlenaryTestPopup", + "grug-far", "help", "lspinfo", "notify", diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index f893b355..1f96f8a2 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -128,13 +128,25 @@ return { -- search/replace in multiple files { - "nvim-pack/nvim-spectre", - build = false, - cmd = "Spectre", - opts = { open_cmd = "noswapfile vnew" }, - -- stylua: ignore + "MagicDuck/grug-far.nvim", + opts = { headerMaxWidth = 80 }, + cmd = "GrugFar", keys = { - { "sr", function() require("spectre").open() end, desc = "Replace in Files (Spectre)" }, + { + "sr", + function() + local is_visual = vim.fn.mode():lower():find("v") + if is_visual then -- needed to make visual selection work + vim.cmd([[normal! v]]) + end + local grug = require("grug-far"); + (is_visual and grug.with_visual_selection or grug.grug_far)({ + prefills = { filesFilter = "*." .. vim.fn.expand("%:e") }, + }) + end, + mode = { "n", "v" }, + desc = "Search and Replace", + }, }, }, diff --git a/lua/lazyvim/plugins/extras/ui/mini-animate.lua b/lua/lazyvim/plugins/extras/ui/mini-animate.lua index 571bee26..1136230a 100644 --- a/lua/lazyvim/plugins/extras/ui/mini-animate.lua +++ b/lua/lazyvim/plugins/extras/ui/mini-animate.lua @@ -14,6 +14,13 @@ return { end, { expr = true }) end + vim.api.nvim_create_autocmd("FileType", { + pattern = "grug-far", + callback = function() + vim.b.minianimate_disable = true + end, + }) + LazyVim.toggle.map("ua", { name = "Mini Animate", get = function() From c8ab5d7554da9f1eff69f5d6d8a0df38309d9f81 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 20 Jul 2024 22:06:16 +0200 Subject: [PATCH 293/323] fix(toggle): safe toggle get --- lua/lazyvim/util/toggle.lua | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/util/toggle.lua b/lua/lazyvim/util/toggle.lua index c8027666..4e0ba494 100644 --- a/lua/lazyvim/util/toggle.lua +++ b/lua/lazyvim/util/toggle.lua @@ -39,14 +39,21 @@ function M.wk(lhs, toggle) if not LazyVim.has("which-key.nvim") then return end + local function safe_get() + local ok, enabled = pcall(toggle.get) + if not ok then + LazyVim.error({ "Failed to get toggle state for **" .. toggle.name .. "**:\n", enabled }, { once = true }) + end + return enabled + end require("which-key").add({ { lhs, icon = function() - return toggle.get() and { icon = " ", color = "green" } or { icon = " ", color = "yellow" } + return safe_get() and { icon = " ", color = "green" } or { icon = " ", color = "yellow" } end, desc = function() - return (toggle.get() and "Disable " or "Enable ") .. toggle.name + return (safe_get() and "Disable " or "Enable ") .. toggle.name end, }, }) From a997152eb2307380888d640440e0732493f82727 Mon Sep 17 00:00:00 2001 From: Shaun Clayton Date: Sat, 20 Jul 2024 16:14:33 -0400 Subject: [PATCH 294/323] feat(indent-blankline): add which-key toggles (#4122) ## Description Add which-key toggle mappings for toggling both the indention guides, and also scope highlight on a per buffer basis. ## Screenshots ![2024-07-20_08-16](https://github.com/user-attachments/assets/7b282868-c035-4f71-97dd-5738cd953713) ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --------- Co-authored-by: Folke Lemaitre --- lua/lazyvim/plugins/ui.lua | 54 +++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 21 deletions(-) diff --git a/lua/lazyvim/plugins/ui.lua b/lua/lazyvim/plugins/ui.lua index ed17182d..14807497 100644 --- a/lua/lazyvim/plugins/ui.lua +++ b/lua/lazyvim/plugins/ui.lua @@ -225,28 +225,40 @@ return { { "lukas-reineke/indent-blankline.nvim", event = "LazyFile", - opts = { - indent = { - char = "│", - tab_char = "│", - }, - scope = { show_start = false, show_end = false }, - exclude = { - filetypes = { - "help", - "alpha", - "dashboard", - "neo-tree", - "Trouble", - "trouble", - "lazy", - "mason", - "notify", - "toggleterm", - "lazyterm", + opts = function() + LazyVim.toggle.map("ug", { + name = "Indention Guides", + get = function() + return require("ibl.config").get_config(0).enabled + end, + set = function(state) + require("ibl").setup_buffer(0, { enabled = state }) + end, + }) + + return { + indent = { + char = "│", + tab_char = "│", }, - }, - }, + scope = { show_start = false, show_end = false }, + exclude = { + filetypes = { + "help", + "alpha", + "dashboard", + "neo-tree", + "Trouble", + "trouble", + "lazy", + "mason", + "notify", + "toggleterm", + "lazyterm", + }, + }, + } + end, main = "ibl", }, From 43dbe0e60d0083f38ab5113a82d9c74229895af2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 20 Jul 2024 22:27:04 +0200 Subject: [PATCH 295/323] chore(main): release 12.34.0 (#4121) :robot: I have created a release *beep* *boop* --- ## [12.34.0](https://github.com/LazyVim/LazyVim/compare/v12.33.0...v12.34.0) (2024-07-20) ### Features * **editor:** replace nvim-spectre with grug-far.nvim ([#4099](https://github.com/LazyVim/LazyVim/issues/4099)) ([0d561a3](https://github.com/LazyVim/LazyVim/commit/0d561a3226b46f6a44c4f2c9be2288f3b52cc351)) * **indent-blankline:** add which-key toggles ([#4122](https://github.com/LazyVim/LazyVim/issues/4122)) ([a997152](https://github.com/LazyVim/LazyVim/commit/a997152eb2307380888d640440e0732493f82727)) ### Bug Fixes * **conform:** changes for new conform.nvim config ([eed91a3](https://github.com/LazyVim/LazyVim/commit/eed91a3e4c1521dd839d1a8bc09bdd98ac2fb874)) * **toggle:** safe toggle get ([c8ab5d7](https://github.com/LazyVim/LazyVim/commit/c8ab5d7554da9f1eff69f5d6d8a0df38309d9f81)) ### Performance Improvements * **core:** defer clipboard because xsel and pbcopy can be slow ([#4120](https://github.com/LazyVim/LazyVim/issues/4120)) ([578f06e](https://github.com/LazyVim/LazyVim/commit/578f06e1401defbbc0a82f9ff1fb505564d038cf)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/.release-please-manifest.json | 2 +- CHANGELOG.md | 19 +++++++++++++++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index 98ca8693..67384c64 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "12.33.0" + ".": "12.34.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 48c3581f..09dbee59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +## [12.34.0](https://github.com/LazyVim/LazyVim/compare/v12.33.0...v12.34.0) (2024-07-20) + + +### Features + +* **editor:** replace nvim-spectre with grug-far.nvim ([#4099](https://github.com/LazyVim/LazyVim/issues/4099)) ([0d561a3](https://github.com/LazyVim/LazyVim/commit/0d561a3226b46f6a44c4f2c9be2288f3b52cc351)) +* **indent-blankline:** add which-key toggles ([#4122](https://github.com/LazyVim/LazyVim/issues/4122)) ([a997152](https://github.com/LazyVim/LazyVim/commit/a997152eb2307380888d640440e0732493f82727)) + + +### Bug Fixes + +* **conform:** changes for new conform.nvim config ([eed91a3](https://github.com/LazyVim/LazyVim/commit/eed91a3e4c1521dd839d1a8bc09bdd98ac2fb874)) +* **toggle:** safe toggle get ([c8ab5d7](https://github.com/LazyVim/LazyVim/commit/c8ab5d7554da9f1eff69f5d6d8a0df38309d9f81)) + + +### Performance Improvements + +* **core:** defer clipboard because xsel and pbcopy can be slow ([#4120](https://github.com/LazyVim/LazyVim/issues/4120)) ([578f06e](https://github.com/LazyVim/LazyVim/commit/578f06e1401defbbc0a82f9ff1fb505564d038cf)) + ## [12.33.0](https://github.com/LazyVim/LazyVim/compare/v12.32.0...v12.33.0) (2024-07-19) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 90051817..d6badcdf 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "12.33.0" -- x-release-please-version +M.version = "12.34.0" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From 61ce1cfaaf8365e3b5c12b1509064579ab7d80b5 Mon Sep 17 00:00:00 2001 From: dotfrag <17456867+dotfrag@users.noreply.github.com> Date: Sun, 21 Jul 2024 13:24:28 +0300 Subject: [PATCH 296/323] feat(python): default to new ruff instead of ruff_lsp (#4126) ## Description Change default python ruff lsp from `ruff_lsp` to `ruff`. It is now marked as stable. I have been using it for a few days without any problems. I use python for relatively small to medium projects. Maybe someone who is using python more rigorously has better feedback. References: https://github.com/astral-sh/ruff-lsp (see note) https://github.com/astral-sh/ruff/releases/tag/0.5.3 https://docs.astral.sh/ruff/editors/setup/#neovim Also the issue in https://github.com/LazyVim/LazyVim/pull/3057 has been resolved. I tested it and I only get 1 `ruff server` process per nvim instance. The processes close correctly when nvim is closed. ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/lang/python.lua | 43 ++++++++++++++-------- lua/lazyvim/plugins/lsp/init.lua | 3 ++ 2 files changed, 30 insertions(+), 16 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/python.lua b/lua/lazyvim/plugins/extras/lang/python.lua index 399f28e3..a06b63d7 100644 --- a/lua/lazyvim/plugins/extras/lang/python.lua +++ b/lua/lazyvim/plugins/extras/lang/python.lua @@ -2,11 +2,12 @@ if lazyvim_docs then -- LSP Server to use for Python. -- Set to "basedpyright" to use basedpyright instead of pyright. vim.g.lazyvim_python_lsp = "pyright" - vim.g.lazyvim_python_ruff = "ruff_lsp" + -- Set to "ruff_lsp" to use the old LSP implementation version. + vim.g.lazyvim_python_ruff = "ruff" end local lsp = vim.g.lazyvim_python_lsp or "pyright" -local ruff = vim.g.lazyvim_python_ruff or "ruff_lsp" +local ruff = vim.g.lazyvim_python_ruff or "ruff" return { recommended = function() @@ -30,22 +31,22 @@ return { "neovim/nvim-lspconfig", opts = { servers = { - pyright = { - enabled = lsp == "pyright", - }, - basedpyright = { - enabled = lsp == "basedpyright", - }, - [lsp] = { - enabled = true, + ruff = { + cmd_env = { RUFF_TRACE = "messages" }, + init_options = { + settings = { + logLevel = "error", + }, + }, + keys = { + { + "co", + LazyVim.lsp.action["source.organizeImports"], + desc = "Organize Imports", + }, + }, }, ruff_lsp = { - enabled = ruff == "ruff_lsp", - }, - ruff = { - enabled = ruff == "ruff", - }, - [ruff] = { keys = { { "co", @@ -65,6 +66,16 @@ return { }, }, }, + { + "neovim/nvim-lspconfig", + opts = function(_, opts) + local servers = { "pyright", "basedpyright", "ruff", "ruff_lsp", ruff, lsp } + for _, server in ipairs(servers) do + opts.servers[server] = opts.servers[server] or {} + opts.servers[server].enabled = server == lsp or server == ruff + end + end, + }, { "nvim-neotest/neotest", optional = true, diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index 0747547f..076344dd 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -196,6 +196,9 @@ return { local server_opts = vim.tbl_deep_extend("force", { capabilities = vim.deepcopy(capabilities), }, servers[server] or {}) + if server_opts.enabled == false then + return + end if opts.setup[server] then if opts.setup[server](server, server_opts) then From 76bc7b402223e011f2bfbd5bc2db98bf6d02262e Mon Sep 17 00:00:00 2001 From: folke Date: Sun, 21 Jul 2024 10:25:26 +0000 Subject: [PATCH 297/323] chore(build): auto-generate docs --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 9a318334..92935de3 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2024 July 20 +*LazyVim.txt* For Neovim Last change: 2024 July 21 ============================================================================== Table of Contents *LazyVim-table-of-contents* From fca038b433a07e36f063a60804f3eae7a0f268ce Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 21 Jul 2024 15:53:07 +0200 Subject: [PATCH 298/323] chore(main): release 12.35.0 (#4128) :robot: I have created a release *beep* *boop* --- ## [12.35.0](https://github.com/LazyVim/LazyVim/compare/v12.34.0...v12.35.0) (2024-07-21) ### Features * **python:** default to new ruff instead of ruff_lsp ([#4126](https://github.com/LazyVim/LazyVim/issues/4126)) ([61ce1cf](https://github.com/LazyVim/LazyVim/commit/61ce1cfaaf8365e3b5c12b1509064579ab7d80b5)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/.release-please-manifest.json | 2 +- CHANGELOG.md | 7 +++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index 67384c64..50859833 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "12.34.0" + ".": "12.35.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 09dbee59..c0081c2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [12.35.0](https://github.com/LazyVim/LazyVim/compare/v12.34.0...v12.35.0) (2024-07-21) + + +### Features + +* **python:** default to new ruff instead of ruff_lsp ([#4126](https://github.com/LazyVim/LazyVim/issues/4126)) ([61ce1cf](https://github.com/LazyVim/LazyVim/commit/61ce1cfaaf8365e3b5c12b1509064579ab7d80b5)) + ## [12.34.0](https://github.com/LazyVim/LazyVim/compare/v12.33.0...v12.34.0) (2024-07-20) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index d6badcdf..6f2477b2 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "12.34.0" -- x-release-please-version +M.version = "12.35.0" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From 6411ab0897f19dad9f902dfee29e101a9a767357 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 21 Jul 2024 17:20:29 +0200 Subject: [PATCH 299/323] fix(grug-far): only prefill files filter when file has an extension. Closes #4130 --- lua/lazyvim/plugins/editor.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 1f96f8a2..2e6444a1 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -139,9 +139,11 @@ return { if is_visual then -- needed to make visual selection work vim.cmd([[normal! v]]) end - local grug = require("grug-far"); + local grug = require("grug-far") + local ext = vim.bo.buftype == "" and vim.fn.expand("%:e") + local filesFilter = ext and ext ~= "" and "*." .. ext or nil; (is_visual and grug.with_visual_selection or grug.grug_far)({ - prefills = { filesFilter = "*." .. vim.fn.expand("%:e") }, + prefills = { filesFilter = filesFilter }, }) end, mode = { "n", "v" }, From 8db2f3af39454ab51422a83cfc6632d013660691 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 21 Jul 2024 17:34:32 +0200 Subject: [PATCH 300/323] chore(main): release 12.35.1 (#4131) :robot: I have created a release *beep* *boop* --- ## [12.35.1](https://github.com/LazyVim/LazyVim/compare/v12.35.0...v12.35.1) (2024-07-21) ### Bug Fixes * **grug-far:** only prefill files filter when file has an extension. Closes [#4130](https://github.com/LazyVim/LazyVim/issues/4130) ([6411ab0](https://github.com/LazyVim/LazyVim/commit/6411ab0897f19dad9f902dfee29e101a9a767357)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/.release-please-manifest.json | 2 +- CHANGELOG.md | 7 +++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index 50859833..5f2f4b51 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "12.35.0" + ".": "12.35.1" } diff --git a/CHANGELOG.md b/CHANGELOG.md index c0081c2e..855e16ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [12.35.1](https://github.com/LazyVim/LazyVim/compare/v12.35.0...v12.35.1) (2024-07-21) + + +### Bug Fixes + +* **grug-far:** only prefill files filter when file has an extension. Closes [#4130](https://github.com/LazyVim/LazyVim/issues/4130) ([6411ab0](https://github.com/LazyVim/LazyVim/commit/6411ab0897f19dad9f902dfee29e101a9a767357)) + ## [12.35.0](https://github.com/LazyVim/LazyVim/compare/v12.34.0...v12.35.0) (2024-07-21) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 6f2477b2..eefdd035 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "12.35.0" -- x-release-please-version +M.version = "12.35.1" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From 72d0cad3530d877401ad9674f5266c79fbec396b Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 22 Jul 2024 08:38:32 +0200 Subject: [PATCH 301/323] feat(grug-far): no longer needed to call visual replace separately --- lua/lazyvim/plugins/editor.lua | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 2e6444a1..28808394 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -135,15 +135,12 @@ return { { "sr", function() - local is_visual = vim.fn.mode():lower():find("v") - if is_visual then -- needed to make visual selection work - vim.cmd([[normal! v]]) - end local grug = require("grug-far") local ext = vim.bo.buftype == "" and vim.fn.expand("%:e") - local filesFilter = ext and ext ~= "" and "*." .. ext or nil; - (is_visual and grug.with_visual_selection or grug.grug_far)({ - prefills = { filesFilter = filesFilter }, + grug.grug_far({ + prefills = { + filesFilter = ext and ext ~= "" and "*." .. ext or nil, + }, }) end, mode = { "n", "v" }, From 3a87ce4afb3a780be14fe3efcd7924570285538c Mon Sep 17 00:00:00 2001 From: folke Date: Mon, 22 Jul 2024 06:39:25 +0000 Subject: [PATCH 302/323] chore(build): auto-generate docs --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 92935de3..a0b980b7 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2024 July 21 +*LazyVim.txt* For Neovim Last change: 2024 July 22 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 5626d98d1c6c4713de3a0629050e0a39daa3fba8 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 22 Jul 2024 14:24:32 +0200 Subject: [PATCH 303/323] ci: update --- .github/workflows/stale.yml | 3 ++- .github/workflows/update.yml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index a0c704be..4e0273bc 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -5,6 +5,7 @@ on: - cron: "30 1 * * *" jobs: - ci: + stale: + if: contains(fromJSON('["folke", "LazyVim"]'), github.repository_owner) uses: folke/github/.github/workflows/stale.yml@main secrets: inherit diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index 2177a50b..6784ef9c 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -7,6 +7,7 @@ on: - cron: "0 * * * *" jobs: - ci: + update: + if: contains(fromJSON('["folke", "LazyVim"]'), github.repository_owner) uses: folke/github/.github/workflows/update.yml@main secrets: inherit From 03968eb3f08036d8b7415712caff7e48b63b8ece Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 22 Jul 2024 14:25:04 +0200 Subject: [PATCH 304/323] chore(main): release 12.36.0 (#4135) :robot: I have created a release *beep* *boop* --- ## [12.36.0](https://github.com/LazyVim/LazyVim/compare/v12.35.1...v12.36.0) (2024-07-22) ### Features * **grug-far:** no longer needed to call visual replace separately ([72d0cad](https://github.com/LazyVim/LazyVim/commit/72d0cad3530d877401ad9674f5266c79fbec396b)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/.release-please-manifest.json | 2 +- CHANGELOG.md | 7 +++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index 5f2f4b51..8560146d 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "12.35.1" + ".": "12.36.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 855e16ba..33cbefe9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [12.36.0](https://github.com/LazyVim/LazyVim/compare/v12.35.1...v12.36.0) (2024-07-22) + + +### Features + +* **grug-far:** no longer needed to call visual replace separately ([72d0cad](https://github.com/LazyVim/LazyVim/commit/72d0cad3530d877401ad9674f5266c79fbec396b)) + ## [12.35.1](https://github.com/LazyVim/LazyVim/compare/v12.35.0...v12.35.1) (2024-07-21) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index eefdd035..e8d943f3 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "12.35.1" -- x-release-please-version +M.version = "12.36.0" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From 1c2be200c185a4567c6a634da2b624d9a638fe73 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 22 Jul 2024 23:26:03 +0200 Subject: [PATCH 305/323] fix(grug-far): use new transient option --- lua/lazyvim/config/autocmds.lua | 1 - lua/lazyvim/plugins/editor.lua | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/config/autocmds.lua b/lua/lazyvim/config/autocmds.lua index edb392db..1440d069 100644 --- a/lua/lazyvim/config/autocmds.lua +++ b/lua/lazyvim/config/autocmds.lua @@ -55,7 +55,6 @@ vim.api.nvim_create_autocmd("FileType", { group = augroup("close_with_q"), pattern = { "PlenaryTestPopup", - "grug-far", "help", "lspinfo", "notify", diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 28808394..18ded3ae 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -138,6 +138,7 @@ return { local grug = require("grug-far") local ext = vim.bo.buftype == "" and vim.fn.expand("%:e") grug.grug_far({ + transient = true, prefills = { filesFilter = ext and ext ~= "" and "*." .. ext or nil, }, From f94a0591b3e5838794b1c3897ec21491aeb080fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?George=20Guimar=C3=A3es?= Date: Mon, 22 Jul 2024 15:11:30 -0700 Subject: [PATCH 306/323] feat(elixir): add elixirls code actions (#4148) This is a refactoring of #3846 with the changes: - Use `Lazyvim.lsp.execute` on keymaps to make everything simpler; - Remove expandMacro. Closes #3846 --------- Co-authored-by: Ahmed Kamal --- lua/lazyvim/plugins/extras/lang/elixir.lua | 27 +++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/elixir.lua b/lua/lazyvim/plugins/extras/lang/elixir.lua index d82e988e..f391edbd 100644 --- a/lua/lazyvim/plugins/extras/lang/elixir.lua +++ b/lua/lazyvim/plugins/extras/lang/elixir.lua @@ -9,7 +9,32 @@ return { "neovim/nvim-lspconfig", opts = { servers = { - elixirls = {}, + elixirls = { + keys = { + { + "cp", + function() + local params = vim.lsp.util.make_position_params() + LazyVim.lsp.execute({ + command = "manipulatePipes:serverid", + arguments = { "toPipe", params.textDocument.uri, params.position.line, params.position.character }, + }) + end, + desc = "To Pipe", + }, + { + "cP", + function() + local params = vim.lsp.util.make_position_params() + LazyVim.lsp.execute({ + command = "manipulatePipes:serverid", + arguments = { "fromPipe", params.textDocument.uri, params.position.line, params.position.character }, + }) + end, + desc = "From Pipe", + }, + }, + }, }, }, }, From f6cd4a38c667e3ef56672d723705ecd8a774a0f4 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 23 Jul 2024 06:55:34 +0200 Subject: [PATCH 307/323] fix(news): deprecated API --- lua/lazyvim/util/news.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/util/news.lua b/lua/lazyvim/util/news.lua index d1a6b44b..69f79256 100644 --- a/lua/lazyvim/util/news.lua +++ b/lua/lazyvim/util/news.lua @@ -81,7 +81,11 @@ function M.open(file, opts) vim.opt_local.signcolumn = "yes" vim.opt_local.statuscolumn = " " vim.opt_local.conceallevel = 3 - vim.diagnostic.disable(float.buf) + if vim.diagnostic.enable then + vim.diagnostic.enable(false, { bufnr = float.buf }) + else + vim.diagnostic.disable(float.buf) + end end return M From 5727da6ff72f6c0b625540a74b3d5877c0aba04e Mon Sep 17 00:00:00 2001 From: folke Date: Tue, 23 Jul 2024 05:18:13 +0000 Subject: [PATCH 308/323] chore(build): auto-generate docs --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index a0b980b7..3873f299 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2024 July 22 +*LazyVim.txt* For Neovim Last change: 2024 July 23 ============================================================================== Table of Contents *LazyVim-table-of-contents* From f0d8b8b293c1fc798b576a74a87f9bd0b59714f3 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 23 Jul 2024 08:29:07 +0200 Subject: [PATCH 309/323] fix(keymaps): leader-wd --- lua/lazyvim/config/keymaps.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/config/keymaps.lua b/lua/lazyvim/config/keymaps.lua index 6468864b..9a0037b1 100644 --- a/lua/lazyvim/config/keymaps.lua +++ b/lua/lazyvim/config/keymaps.lua @@ -177,7 +177,7 @@ map("t", "", "close", { desc = "which_key_ignore" }) map("n", "w", "", { desc = "Windows", remap = true }) map("n", "-", "s", { desc = "Split Window Below", remap = true }) map("n", "|", "v", { desc = "Split Window Right", remap = true }) -map("n", "d", "c", { desc = "Delete Window", remap = true }) +map("n", "wd", "c", { desc = "Delete Window", remap = true }) LazyVim.toggle.map("m", LazyVim.toggle.maximize) -- tabs From caf227dd08e83c826800cb88c34c87c600793fa3 Mon Sep 17 00:00:00 2001 From: Miguel Palau Date: Tue, 23 Jul 2024 09:05:18 -0600 Subject: [PATCH 310/323] fix(dap): extend dap.configurations from .vscode/launch.json (#4106) ## Description This PR allows the nvim-dap module to read from vscode's launch.json and add those configurations to the ones in nvim-dap. ## Related Issue(s) ## Screenshots Before: image After: image ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --------- Co-authored-by: Micah Halter --- lua/lazyvim/plugins/extras/dap/core.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua/lazyvim/plugins/extras/dap/core.lua b/lua/lazyvim/plugins/extras/dap/core.lua index ac6709f1..67a3d71b 100644 --- a/lua/lazyvim/plugins/extras/dap/core.lua +++ b/lua/lazyvim/plugins/extras/dap/core.lua @@ -69,6 +69,11 @@ return { vscode.json_decode = function(str) return vim.json.decode(json.json_strip_comments(str)) end + + -- Extends dap.configurations with entries read from .vscode/launch.json + if vim.fn.filereadable(".vscode/launch.json") then + vscode.load_launchjs() + end end, }, From 940d7df59aac01f6cc587f035d9b4913139fae60 Mon Sep 17 00:00:00 2001 From: moetayuko Date: Wed, 24 Jul 2024 03:27:29 +0800 Subject: [PATCH 311/323] fix(dap): don't mess up DAP adapters provided by nvim-dap-python (#4141) ## Description * mason-nvim-dap.nvim ships a `Python: Launch file` adapter which does the same thing as `Launch file` of nvim-dap-python, providing both doesn't make sense and confuses the users. * mason-nvim-dap.nvim unexpectedly overrides nvim-dap-python's adapters and breaks its venv detection. As a result, user programs are always executed in mason debugpy venv rather than the activated one. ## Related Issue(s) Fixes #3064 ## Screenshots ## Checklist - [X] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/lang/python.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lua/lazyvim/plugins/extras/lang/python.lua b/lua/lazyvim/plugins/extras/lang/python.lua index a06b63d7..f85b23be 100644 --- a/lua/lazyvim/plugins/extras/lang/python.lua +++ b/lua/lazyvim/plugins/extras/lang/python.lua @@ -138,4 +138,15 @@ return { table.insert(opts.auto_brackets, "python") end, }, + + -- Don't mess up DAP adapters provided by nvim-dap-python + { + "jay-babu/mason-nvim-dap.nvim", + optional = true, + opts = { + handlers = { + python = function() end, + }, + }, + }, } From 4bf6d856a805d38c19c8485c7a062d6cbc5cfaa8 Mon Sep 17 00:00:00 2001 From: EJ <8498296+maddawik@users.noreply.github.com> Date: Wed, 24 Jul 2024 00:26:27 -0400 Subject: [PATCH 312/323] feat(catppuccin): enable grug-far integration (#4156) ## Description This enables the recently added `grug-far` integration in catppuccin - https://github.com/catppuccin/nvim/pull/735 ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/colorscheme.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/colorscheme.lua b/lua/lazyvim/plugins/colorscheme.lua index bb63326e..c6376e1b 100644 --- a/lua/lazyvim/plugins/colorscheme.lua +++ b/lua/lazyvim/plugins/colorscheme.lua @@ -19,6 +19,7 @@ return { cmp = true, dashboard = true, flash = true, + grug_far = true, gitsigns = true, headlines = true, illuminate = true, From ec8de342d7057be3da4a838faa565b66b2db6359 Mon Sep 17 00:00:00 2001 From: folke Date: Wed, 24 Jul 2024 04:27:22 +0000 Subject: [PATCH 313/323] chore(build): auto-generate docs --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 3873f299..682741ae 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2024 July 23 +*LazyVim.txt* For Neovim Last change: 2024 July 24 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 391f506295607e12db545b85fcbe0e00b1b8efa9 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 24 Jul 2024 07:03:44 +0200 Subject: [PATCH 314/323] fix(keymaps): leader-wm --- lua/lazyvim/config/keymaps.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/config/keymaps.lua b/lua/lazyvim/config/keymaps.lua index 9a0037b1..a6f1c574 100644 --- a/lua/lazyvim/config/keymaps.lua +++ b/lua/lazyvim/config/keymaps.lua @@ -178,7 +178,7 @@ map("n", "w", "", { desc = "Windows", remap = true }) map("n", "-", "s", { desc = "Split Window Below", remap = true }) map("n", "|", "v", { desc = "Split Window Right", remap = true }) map("n", "wd", "c", { desc = "Delete Window", remap = true }) -LazyVim.toggle.map("m", LazyVim.toggle.maximize) +LazyVim.toggle.map("wm", LazyVim.toggle.maximize) -- tabs map("n", "l", "tablast", { desc = "Last Tab" }) From 489a7a8e844e1757950d24828a2919f385ab73f4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 24 Jul 2024 07:05:03 +0200 Subject: [PATCH 315/323] chore(main): release 12.37.0 (#4147) :robot: I have created a release *beep* *boop* --- ## [12.37.0](https://github.com/LazyVim/LazyVim/compare/v12.36.0...v12.37.0) (2024-07-24) ### Features * **catppuccin:** enable grug-far integration ([#4156](https://github.com/LazyVim/LazyVim/issues/4156)) ([4bf6d85](https://github.com/LazyVim/LazyVim/commit/4bf6d856a805d38c19c8485c7a062d6cbc5cfaa8)) * **elixir:** add elixirls code actions ([#4148](https://github.com/LazyVim/LazyVim/issues/4148)) ([f94a059](https://github.com/LazyVim/LazyVim/commit/f94a0591b3e5838794b1c3897ec21491aeb080fe)) ### Bug Fixes * **dap:** don't mess up DAP adapters provided by nvim-dap-python ([#4141](https://github.com/LazyVim/LazyVim/issues/4141)) ([940d7df](https://github.com/LazyVim/LazyVim/commit/940d7df59aac01f6cc587f035d9b4913139fae60)) * **dap:** extend dap.configurations from .vscode/launch.json ([#4106](https://github.com/LazyVim/LazyVim/issues/4106)) ([caf227d](https://github.com/LazyVim/LazyVim/commit/caf227dd08e83c826800cb88c34c87c600793fa3)) * **grug-far:** use new transient option ([1c2be20](https://github.com/LazyVim/LazyVim/commit/1c2be200c185a4567c6a634da2b624d9a638fe73)) * **keymaps:** leader-wd ([f0d8b8b](https://github.com/LazyVim/LazyVim/commit/f0d8b8b293c1fc798b576a74a87f9bd0b59714f3)) * **keymaps:** leader-wm ([391f506](https://github.com/LazyVim/LazyVim/commit/391f506295607e12db545b85fcbe0e00b1b8efa9)) * **news:** deprecated API ([f6cd4a3](https://github.com/LazyVim/LazyVim/commit/f6cd4a38c667e3ef56672d723705ecd8a774a0f4)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/.release-please-manifest.json | 2 +- CHANGELOG.md | 18 ++++++++++++++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index 8560146d..6521921c 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "12.36.0" + ".": "12.37.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 33cbefe9..491d2502 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Changelog +## [12.37.0](https://github.com/LazyVim/LazyVim/compare/v12.36.0...v12.37.0) (2024-07-24) + + +### Features + +* **catppuccin:** enable grug-far integration ([#4156](https://github.com/LazyVim/LazyVim/issues/4156)) ([4bf6d85](https://github.com/LazyVim/LazyVim/commit/4bf6d856a805d38c19c8485c7a062d6cbc5cfaa8)) +* **elixir:** add elixirls code actions ([#4148](https://github.com/LazyVim/LazyVim/issues/4148)) ([f94a059](https://github.com/LazyVim/LazyVim/commit/f94a0591b3e5838794b1c3897ec21491aeb080fe)) + + +### Bug Fixes + +* **dap:** don't mess up DAP adapters provided by nvim-dap-python ([#4141](https://github.com/LazyVim/LazyVim/issues/4141)) ([940d7df](https://github.com/LazyVim/LazyVim/commit/940d7df59aac01f6cc587f035d9b4913139fae60)) +* **dap:** extend dap.configurations from .vscode/launch.json ([#4106](https://github.com/LazyVim/LazyVim/issues/4106)) ([caf227d](https://github.com/LazyVim/LazyVim/commit/caf227dd08e83c826800cb88c34c87c600793fa3)) +* **grug-far:** use new transient option ([1c2be20](https://github.com/LazyVim/LazyVim/commit/1c2be200c185a4567c6a634da2b624d9a638fe73)) +* **keymaps:** leader-wd ([f0d8b8b](https://github.com/LazyVim/LazyVim/commit/f0d8b8b293c1fc798b576a74a87f9bd0b59714f3)) +* **keymaps:** leader-wm ([391f506](https://github.com/LazyVim/LazyVim/commit/391f506295607e12db545b85fcbe0e00b1b8efa9)) +* **news:** deprecated API ([f6cd4a3](https://github.com/LazyVim/LazyVim/commit/f6cd4a38c667e3ef56672d723705ecd8a774a0f4)) + ## [12.36.0](https://github.com/LazyVim/LazyVim/compare/v12.35.1...v12.36.0) (2024-07-22) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index e8d943f3..5efeb422 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "12.36.0" -- x-release-please-version +M.version = "12.37.0" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From 264abdf9d52fe44c1dcb66f0502dcba5a881ea43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?George=20Guimar=C3=A3es?= Date: Tue, 23 Jul 2024 23:02:56 -0700 Subject: [PATCH 316/323] feat(markdown): replace `headlines.nvim` by `markdown.nvim` (#4139) Okay, so https://github.com/MeanderingProgrammer/markdown.nvim?tab=readme-ov-file is a new kid on the block that I've been enjoying a lot. It replaces headlines.nvim. This new extra is a way for folks to try markdown.nvim effortlessly. (Should I add here everything from the current markdown extra to make this extra a complete drop-in replacement?) --------- Co-authored-by: Folke Lemaitre --- NEWS.md | 3 ++ lua/lazyvim/plugins/extras/lang/markdown.lua | 39 +++++++------------- 2 files changed, 17 insertions(+), 25 deletions(-) diff --git a/NEWS.md b/NEWS.md index 1abf2ec8..20b6156b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,9 @@ ## 12.x +- **Markdown Extra**: [headlines.nvim](https://github.com/lukas-reineke/headlines.nvim) has been removed in favor of [markdown.nvim](https://github.com/MeanderingProgrammer/markdown.nvim) + to spice up your markdown files. + - [nvim-spectre](https://github.com/nvim-pack/nvim-spectre) has been removed in favor of [grug-far.nvim](https://github.com/MagicDuck/grug-far.nvim). **grug-far.nvim** has a great UI and feels more intuitive to use. diff --git a/lua/lazyvim/plugins/extras/lang/markdown.lua b/lua/lazyvim/plugins/extras/lang/markdown.lua index 7d026b23..2257d73e 100644 --- a/lua/lazyvim/plugins/extras/lang/markdown.lua +++ b/lua/lazyvim/plugins/extras/lang/markdown.lua @@ -92,31 +92,20 @@ return { }, { - "lukas-reineke/headlines.nvim", - opts = function() - local opts = {} - for _, ft in ipairs({ "markdown", "norg", "rmd", "org" }) do - opts[ft] = { - headline_highlights = {}, - -- disable bullets for now. See https://github.com/lukas-reineke/headlines.nvim/issues/66 - bullets = {}, - quote_string = false, - } - for i = 1, 6 do - local hl = "Headline" .. i - vim.api.nvim_set_hl(0, hl, { link = "Headline", default = true }) - table.insert(opts[ft].headline_highlights, hl) - end - end - return opts - end, + "MeanderingProgrammer/markdown.nvim", + opts = { + file_types = { "markdown", "norg", "rmd", "org" }, + code = { + sign = false, + width = "block", + right_pad = 1, + }, + heading = { + sign = false, + icons = {}, + }, + }, ft = { "markdown", "norg", "rmd", "org" }, - config = function(_, opts) - -- PERF: schedule to prevent headlines slowing down opening a file - vim.schedule(function() - require("headlines").setup(opts) - require("headlines").refresh() - end) - end, + enabled = true, }, } From c8d0faf9b152283b2ae74f9594287a834eae002a Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 24 Jul 2024 08:21:36 +0200 Subject: [PATCH 317/323] feat(markdown): markdown-render toggle --- lua/lazyvim/plugins/extras/lang/markdown.lua | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/markdown.lua b/lua/lazyvim/plugins/extras/lang/markdown.lua index 2257d73e..0934f10a 100644 --- a/lua/lazyvim/plugins/extras/lang/markdown.lua +++ b/lua/lazyvim/plugins/extras/lang/markdown.lua @@ -106,6 +106,22 @@ return { }, }, ft = { "markdown", "norg", "rmd", "org" }, - enabled = true, + config = function(_, opts) + require("render-markdown").setup(opts) + LazyVim.toggle.map("um", { + name = "Render Markdown", + get = function() + return require("render-markdown.state").enabled + end, + set = function(enabled) + local m = require("render-markdown") + if enabled then + m.enable() + else + m.disable() + end + end, + }) + end, }, } From 71b26905822e81ec4a3842947d32a1b46c185948 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 24 Jul 2024 08:30:15 +0200 Subject: [PATCH 318/323] chore(main): release 12.38.0 (#4158) :robot: I have created a release *beep* *boop* --- ## [12.38.0](https://github.com/LazyVim/LazyVim/compare/v12.37.0...v12.38.0) (2024-07-24) ### Features * **markdown:** markdown-render toggle ([c8d0faf](https://github.com/LazyVim/LazyVim/commit/c8d0faf9b152283b2ae74f9594287a834eae002a)) * **markdown:** replace `headlines.nvim` by `markdown.nvim` ([#4139](https://github.com/LazyVim/LazyVim/issues/4139)) ([264abdf](https://github.com/LazyVim/LazyVim/commit/264abdf9d52fe44c1dcb66f0502dcba5a881ea43)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/.release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index 6521921c..246eb3cd 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "12.37.0" + ".": "12.38.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 491d2502..58c2a2ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [12.38.0](https://github.com/LazyVim/LazyVim/compare/v12.37.0...v12.38.0) (2024-07-24) + + +### Features + +* **markdown:** markdown-render toggle ([c8d0faf](https://github.com/LazyVim/LazyVim/commit/c8d0faf9b152283b2ae74f9594287a834eae002a)) +* **markdown:** replace `headlines.nvim` by `markdown.nvim` ([#4139](https://github.com/LazyVim/LazyVim/issues/4139)) ([264abdf](https://github.com/LazyVim/LazyVim/commit/264abdf9d52fe44c1dcb66f0502dcba5a881ea43)) + ## [12.37.0](https://github.com/LazyVim/LazyVim/compare/v12.36.0...v12.37.0) (2024-07-24) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 5efeb422..5b293612 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "12.37.0" -- x-release-please-version +M.version = "12.38.0" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From 328272144c8c0b2d96988770d48c690a72613a81 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 24 Jul 2024 18:17:58 +0200 Subject: [PATCH 319/323] fix(autcmds): added grug-far to close with q --- lua/lazyvim/config/autocmds.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/config/autocmds.lua b/lua/lazyvim/config/autocmds.lua index 1440d069..edb392db 100644 --- a/lua/lazyvim/config/autocmds.lua +++ b/lua/lazyvim/config/autocmds.lua @@ -55,6 +55,7 @@ vim.api.nvim_create_autocmd("FileType", { group = augroup("close_with_q"), pattern = { "PlenaryTestPopup", + "grug-far", "help", "lspinfo", "notify", From bcbab77f0c5851e6d73f275f2d27c3baa4f6aa68 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 24 Jul 2024 18:49:45 +0200 Subject: [PATCH 320/323] chore(main): release 12.38.1 (#4167) :robot: I have created a release *beep* *boop* --- ## [12.38.1](https://github.com/LazyVim/LazyVim/compare/v12.38.0...v12.38.1) (2024-07-24) ### Bug Fixes * **autcmds:** added grug-far to close with q ([3282721](https://github.com/LazyVim/LazyVim/commit/328272144c8c0b2d96988770d48c690a72613a81)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/.release-please-manifest.json | 2 +- CHANGELOG.md | 7 +++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index 246eb3cd..5311a37b 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "12.38.0" + ".": "12.38.1" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 58c2a2ce..c99bc273 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [12.38.1](https://github.com/LazyVim/LazyVim/compare/v12.38.0...v12.38.1) (2024-07-24) + + +### Bug Fixes + +* **autcmds:** added grug-far to close with q ([3282721](https://github.com/LazyVim/LazyVim/commit/328272144c8c0b2d96988770d48c690a72613a81)) + ## [12.38.0](https://github.com/LazyVim/LazyVim/compare/v12.37.0...v12.38.0) (2024-07-24) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 5b293612..406ef85c 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "12.38.0" -- x-release-please-version +M.version = "12.38.1" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions From 94bf4f932482012306fb375c4418a398bb00a949 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 25 Jul 2024 10:55:06 +0200 Subject: [PATCH 321/323] fix(news): pcall diag when showing news for older Neovim versions --- lua/lazyvim/util/news.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/lazyvim/util/news.lua b/lua/lazyvim/util/news.lua index 69f79256..5fb4a08c 100644 --- a/lua/lazyvim/util/news.lua +++ b/lua/lazyvim/util/news.lua @@ -82,9 +82,9 @@ function M.open(file, opts) vim.opt_local.statuscolumn = " " vim.opt_local.conceallevel = 3 if vim.diagnostic.enable then - vim.diagnostic.enable(false, { bufnr = float.buf }) + pcall(vim.diagnostic.enable, false, { bufnr = float.buf }) else - vim.diagnostic.disable(float.buf) + pcall(vim.diagnostic.disable, float.buf) end end From deceafc0f9159fa194804ec0c4f26ba08f4ec838 Mon Sep 17 00:00:00 2001 From: folke Date: Thu, 25 Jul 2024 08:56:05 +0000 Subject: [PATCH 322/323] chore(build): auto-generate docs --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 682741ae..70d3657a 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2024 July 24 +*LazyVim.txt* For Neovim Last change: 2024 July 25 ============================================================================== Table of Contents *LazyVim-table-of-contents* From 12818a6cb499456f4903c5d8e68af43753ebc869 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 25 Jul 2024 11:07:00 +0200 Subject: [PATCH 323/323] chore(main): release 12.38.2 (#4178) :robot: I have created a release *beep* *boop* --- ## [12.38.2](https://github.com/LazyVim/LazyVim/compare/v12.38.1...v12.38.2) (2024-07-25) ### Bug Fixes * **news:** pcall diag when showing news for older Neovim versions ([94bf4f9](https://github.com/LazyVim/LazyVim/commit/94bf4f932482012306fb375c4418a398bb00a949)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/.release-please-manifest.json | 2 +- CHANGELOG.md | 7 +++++++ lua/lazyvim/config/init.lua | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index 5311a37b..b9d0dcaf 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "12.38.1" + ".": "12.38.2" } diff --git a/CHANGELOG.md b/CHANGELOG.md index c99bc273..9c626d98 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [12.38.2](https://github.com/LazyVim/LazyVim/compare/v12.38.1...v12.38.2) (2024-07-25) + + +### Bug Fixes + +* **news:** pcall diag when showing news for older Neovim versions ([94bf4f9](https://github.com/LazyVim/LazyVim/commit/94bf4f932482012306fb375c4418a398bb00a949)) + ## [12.38.1](https://github.com/LazyVim/LazyVim/compare/v12.38.0...v12.38.1) (2024-07-24) diff --git a/lua/lazyvim/config/init.lua b/lua/lazyvim/config/init.lua index 406ef85c..f6978842 100644 --- a/lua/lazyvim/config/init.lua +++ b/lua/lazyvim/config/init.lua @@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util") ---@class LazyVimConfig: LazyVimOptions local M = {} -M.version = "12.38.1" -- x-release-please-version +M.version = "12.38.2" -- x-release-please-version LazyVim.config = M ---@class LazyVimOptions