From c5978d7e8c047390ec51a7bba78cdd9180954c71 Mon Sep 17 00:00:00 2001 From: Tom Mi Date: Sat, 22 Apr 2023 20:23:56 +0000 Subject: [PATCH 01/14] fix: remove help causing error as nonexistent (#23) --- lua/plugins/example.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lua/plugins/example.lua b/lua/plugins/example.lua index 39f342f..ecc9567 100644 --- a/lua/plugins/example.lua +++ b/lua/plugins/example.lua @@ -142,7 +142,6 @@ return { opts = { ensure_installed = { "bash", - "help", "html", "javascript", "json", @@ -168,8 +167,8 @@ return { opts = function(_, opts) -- add tsx and treesitter vim.list_extend(opts.ensure_installed, { - "tsx", - "typescript", + "tsx", + "typescript", }) end, }, From d9aa1d0f08d2b9b29765132b401175da125031e8 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 28 May 2023 12:22:52 +0200 Subject: [PATCH 02/14] style: typo --- lua/plugins/example.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugins/example.lua b/lua/plugins/example.lua index ecc9567..5d2c1f8 100644 --- a/lua/plugins/example.lua +++ b/lua/plugins/example.lua @@ -242,7 +242,7 @@ return { if cmp.visible() then cmp.select_next_item() -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() - -- they way you will only jump inside the snippet region + -- this way you will only jump inside the snippet region elseif luasnip.expand_or_jumpable() then luasnip.expand_or_jump() elseif has_words_before() then From a13d5c90769ce6177d1e27b46efd967ed52c1d68 Mon Sep 17 00:00:00 2001 From: Miles Ramage <53498605+JustALawnGnome7@users.noreply.github.com> Date: Fri, 2 Jun 2023 16:27:43 -0500 Subject: [PATCH 03/14] docs: corrected plugin spec location (#25) Also fixed minor typos and ambiguities. --- lua/plugins/example.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/plugins/example.lua b/lua/plugins/example.lua index 5d2c1f8..78a3370 100644 --- a/lua/plugins/example.lua +++ b/lua/plugins/example.lua @@ -2,7 +2,7 @@ -- stylua: ignore if true then return {} end --- every spec file under config.plugins will be loaded automatically by lazy.nvim +-- every spec file under the "plugins" directory will be loaded automatically by lazy.nvim -- -- In your plugin files, you can: -- * add extra plugins @@ -196,7 +196,7 @@ return { -- use mini.starter instead of alpha { import = "lazyvim.plugins.extras.ui.mini-starter" }, - -- add jsonls and schemastore ans setup treesitter for json, json5 and jsonc + -- add jsonls and schemastore packages, and setup treesitter for json, json5 and jsonc { import = "lazyvim.plugins.extras.lang.json" }, -- add any tools you want to have installed below From 92b2689e6f11004e65376e84912e61b9e6c58827 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 9 Oct 2023 10:28:53 +0200 Subject: [PATCH 04/14] docs: simplify cmp-emoji example --- lua/plugins/example.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lua/plugins/example.lua b/lua/plugins/example.lua index 78a3370..f84ebdc 100644 --- a/lua/plugins/example.lua +++ b/lua/plugins/example.lua @@ -44,8 +44,7 @@ return { dependencies = { "hrsh7th/cmp-emoji" }, ---@param opts cmp.ConfigSchema opts = function(_, opts) - local cmp = require("cmp") - opts.sources = cmp.config.sources(vim.list_extend(opts.sources, { { name = "emoji" } })) + table.insert(opts.sources, { name = "emoji" }) end, }, From 741ff3aa70336abb6c76ee4c49815ae589a1b852 Mon Sep 17 00:00:00 2001 From: Joshua Davis <114495200+joshryandavis@users.noreply.github.com> Date: Fri, 19 Jan 2024 15:12:29 +0000 Subject: [PATCH 05/14] fix: on_attach deprecated, replace with lsp.on_attach (#45) --- lua/plugins/example.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugins/example.lua b/lua/plugins/example.lua index f84ebdc..6859c0e 100644 --- a/lua/plugins/example.lua +++ b/lua/plugins/example.lua @@ -102,7 +102,7 @@ return { dependencies = { "jose-elias-alvarez/typescript.nvim", init = function() - require("lazyvim.util").on_attach(function(_, buffer) + require("lazyvim.util").lsp.on_attach(function(_, buffer) -- stylua: ignore vim.keymap.set( "n", "co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" }) vim.keymap.set("n", "cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer }) From 914c60ae75cdf61bf77434d2ad2fbf775efd963b Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 21 Mar 2024 17:47:04 +0100 Subject: [PATCH 06/14] fix: removed some outdated examples --- lua/plugins/example.lua | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/lua/plugins/example.lua b/lua/plugins/example.lua index 6859c0e..de22bc8 100644 --- a/lua/plugins/example.lua +++ b/lua/plugins/example.lua @@ -30,14 +30,6 @@ return { -- disable trouble { "folke/trouble.nvim", enabled = false }, - -- add symbols-outline - { - "simrat39/symbols-outline.nvim", - cmd = "SymbolsOutline", - keys = { { "cs", "SymbolsOutline", desc = "Symbols Outline" } }, - config = true, - }, - -- override nvim-cmp and add cmp-emoji { "hrsh7th/nvim-cmp", @@ -71,18 +63,6 @@ return { }, }, - -- add telescope-fzf-native - { - "telescope.nvim", - dependencies = { - "nvim-telescope/telescope-fzf-native.nvim", - build = "make", - config = function() - require("telescope").load_extension("fzf") - end, - }, - }, - -- add pyright to lspconfig { "neovim/nvim-lspconfig", From 75625b29e8891938218043a7d619d67f79666a8d Mon Sep 17 00:00:00 2001 From: denartha10 <98868685+denartha10@users.noreply.github.com> Date: Fri, 29 Mar 2024 16:53:46 +0000 Subject: [PATCH 07/14] fix: Deperecated syntax in bootstrapping of LazyVim starter (#56) In the current state of the lazy.nvim repository, certain updates have been made. However, there remains an outdated reference to 'vim.loop' for the bootstrapping process of 'lazyvim' in this start repo for LazyVim, despite 'vim.loop' being deprecated. To rectify this, I suggest a minor alteration by replacing it with the following code snippet: ```lua if not (vim.uv or vim.loop).fs_stat(lazypath) then -- bootstrap do ``` --- lua/config/lazy.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua index 891b190..fd269d7 100644 --- a/lua/config/lazy.lua +++ b/lua/config/lazy.lua @@ -1,5 +1,6 @@ local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not vim.loop.fs_stat(lazypath) then + +if not (vim.uv or vim.loop).fs_stat(lazypath) then -- bootstrap lazy.nvim -- stylua: ignore vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath }) From b59e7c315b668182320702fd2944eda9f74a3314 Mon Sep 17 00:00:00 2001 From: Alex Ford Date: Sun, 19 May 2024 01:33:42 -0600 Subject: [PATCH 08/14] docs: Update example plugin file to use native snippets with supertab. (#66) --- lua/plugins/example.lua | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/lua/plugins/example.lua b/lua/plugins/example.lua index de22bc8..8b7eabc 100644 --- a/lua/plugins/example.lua +++ b/lua/plugins/example.lua @@ -192,14 +192,6 @@ return { }, -- Use for completion and snippets (supertab) - -- first: disable default and behavior in LuaSnip - { - "L3MON4D3/LuaSnip", - keys = function() - return {} - end, - }, - -- then: setup supertab in cmp { "hrsh7th/nvim-cmp", dependencies = { @@ -213,17 +205,16 @@ return { return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil end - local luasnip = require("luasnip") local cmp = require("cmp") opts.mapping = vim.tbl_extend("force", opts.mapping, { [""] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_next_item() - -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() - -- this way you will only jump inside the snippet region - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() + elseif vim.snippet.active({ direction = 1 }) then + vim.schedule(function() + vim.snippet.jump(1) + end) elseif has_words_before() then cmp.complete() else @@ -233,8 +224,10 @@ return { [""] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) + elseif vim.snippet.active({ direction = -1 }) then + vim.schedule(function() + vim.snippet.jump(-1) + end) else fallback() end From 4818e4b72fc24b0fceed88f83e21e908def4c386 Mon Sep 17 00:00:00 2001 From: DrummyFloyd Date: Sun, 2 Jun 2024 17:00:03 +0200 Subject: [PATCH 09/14] fix: removed unnecessary env var (#67) according to https://github.com/LazyVim/LazyVim/issues/2063#issuecomment-2143841592 this is not needed --- lua/config/lazy.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua index fd269d7..2e7bf62 100644 --- a/lua/config/lazy.lua +++ b/lua/config/lazy.lua @@ -5,7 +5,7 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then -- stylua: ignore vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath }) end -vim.opt.rtp:prepend(vim.env.LAZY or lazypath) +vim.opt.rtp:prepend(lazypath) require("lazy").setup({ spec = { From cb79b0e6a9d0ec81041150dc87fe47352a54a2ba Mon Sep 17 00:00:00 2001 From: Lucas Date: Fri, 14 Jun 2024 10:14:39 +0200 Subject: [PATCH 10/14] fix: improve comment about extras loading in config (#75) * fix: improve comment about extras loading in config * fix: use LazyExtras --------- Co-authored-by: Folke Lemaitre --- lua/config/lazy.lua | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua index 2e7bf62..4aeb4bd 100644 --- a/lua/config/lazy.lua +++ b/lua/config/lazy.lua @@ -11,10 +11,6 @@ require("lazy").setup({ spec = { -- add LazyVim and import its plugins { "LazyVim/LazyVim", import = "lazyvim.plugins" }, - -- import any extras modules here - -- { import = "lazyvim.plugins.extras.lang.typescript" }, - -- { import = "lazyvim.plugins.extras.lang.json" }, - -- { import = "lazyvim.plugins.extras.ui.mini-animate" }, -- import/override with your plugins { import = "plugins" }, }, From 0c370f4d5c537e6d41dea31b547accc8d5f70a8a Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 18 Jun 2024 07:11:12 +0200 Subject: [PATCH 11/14] docs: removed supertab example --- lua/plugins/example.lua | 45 ----------------------------------------- 1 file changed, 45 deletions(-) diff --git a/lua/plugins/example.lua b/lua/plugins/example.lua index 8b7eabc..4ad9825 100644 --- a/lua/plugins/example.lua +++ b/lua/plugins/example.lua @@ -190,49 +190,4 @@ return { }, }, }, - - -- Use for completion and snippets (supertab) - { - "hrsh7th/nvim-cmp", - dependencies = { - "hrsh7th/cmp-emoji", - }, - ---@param opts cmp.ConfigSchema - opts = function(_, opts) - local has_words_before = function() - unpack = unpack or table.unpack - local line, col = unpack(vim.api.nvim_win_get_cursor(0)) - return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil - end - - local cmp = require("cmp") - - opts.mapping = vim.tbl_extend("force", opts.mapping, { - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif vim.snippet.active({ direction = 1 }) then - vim.schedule(function() - vim.snippet.jump(1) - end) - elseif has_words_before() then - cmp.complete() - else - fallback() - end - end, { "i", "s" }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif vim.snippet.active({ direction = -1 }) then - vim.schedule(function() - vim.snippet.jump(-1) - end) - else - fallback() - end - end, { "i", "s" }), - }) - end, - }, } From 79b3f27f5cea8fe6bbb95ba04f93dffa545c5197 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 3 Jul 2024 10:19:46 +0200 Subject: [PATCH 12/14] fix: add error handling to initial clone --- lua/config/lazy.lua | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua index 4aeb4bd..732f55a 100644 --- a/lua/config/lazy.lua +++ b/lua/config/lazy.lua @@ -1,9 +1,16 @@ local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" - if not (vim.uv or vim.loop).fs_stat(lazypath) then - -- bootstrap lazy.nvim - -- stylua: ignore - vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath }) + local lazyrepo = "https://github.com/folke/lazy.nvim.git" + local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) + if vim.v.shell_error ~= 0 then + vim.api.nvim_echo({ + { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, + { out, "WarningMsg" }, + { "\nPress any key to exit..." }, + }, true, {}) + vim.fn.getchar() + os.exit(1) + end end vim.opt.rtp:prepend(lazypath) From cb6349c8ae922d1c5745574f4d17b44f2731d451 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 20 Jul 2024 23:30:46 +0200 Subject: [PATCH 13/14] fix: disable lazy checker notify by default --- lua/config/lazy.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua index 732f55a..d73bfa1 100644 --- a/lua/config/lazy.lua +++ b/lua/config/lazy.lua @@ -31,7 +31,10 @@ require("lazy").setup({ -- version = "*", -- try installing the latest stable version for plugins that support semver }, install = { colorscheme = { "tokyonight", "habamax" } }, - checker = { enabled = true }, -- automatically check for plugin updates + checker = { + enabled = true, -- check for plugin updates periodically + notify = false, -- notify on update + }, -- automatically check for plugin updates performance = { rtp = { -- disable some rtp plugins From 7a10a75dc3fc2fc6a4f35f2eb33d12995ac9efca Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Tue, 22 Oct 2024 12:11:31 +0300 Subject: [PATCH 14/14] docs: fix `lualine` component example (#95) As per https://github.com/LazyVim/LazyVim/issues/4544 it creates confusion to the users who are just trying out the example to try things out. Better to avoid such misinterpretations in the future. I'm assuming this will also update the docs automatically as I can deduce from https://github.com/LazyVim/lazyvim.github.io/blob/25af26046a30be110f0aa19c87ad2a1a1e53ce45/lua/build.lua#L369-L372? --- lua/plugins/example.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/plugins/example.lua b/lua/plugins/example.lua index 4ad9825..17f53d6 100644 --- a/lua/plugins/example.lua +++ b/lua/plugins/example.lua @@ -157,7 +157,11 @@ return { "nvim-lualine/lualine.nvim", event = "VeryLazy", opts = function(_, opts) - table.insert(opts.sections.lualine_x, "😄") + table.insert(opts.sections.lualine_x, { + function() + return "😄" + end, + }) end, },