From 914c60ae75cdf61bf77434d2ad2fbf775efd963b Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 21 Mar 2024 17:47:04 +0100 Subject: [PATCH 1/7] 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 2/7] 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 3/7] 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 4/7] 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 5/7] 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 6/7] 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 7/7] 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)