From 2d9f2a995e77b6e21c7495127bab7cc2fe7a2a42 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Sat, 4 Dec 2021 01:30:38 +0000 Subject: [PATCH] chore(nvim): switch to numToStr/Comment.nvim --- nvim/.config/nvim/after/plugin/comment.lua | 14 ++++++++++++++ nvim/.config/nvim/lua/opdavies/packer.lua | 3 +-- nvim/.config/nvim/plugin/packer_compiled.lua | 17 ++++++----------- 3 files changed, 21 insertions(+), 13 deletions(-) create mode 100644 nvim/.config/nvim/after/plugin/comment.lua diff --git a/nvim/.config/nvim/after/plugin/comment.lua b/nvim/.config/nvim/after/plugin/comment.lua new file mode 100644 index 0000000..35bbc9b --- /dev/null +++ b/nvim/.config/nvim/after/plugin/comment.lua @@ -0,0 +1,14 @@ +require 'Comment'.setup { + padding = true, + + opleader = { + line = 'gc', + block = 'gb', + }, + + mappings = { + basic = true, + extra = true, + extended = false, + }, +} diff --git a/nvim/.config/nvim/lua/opdavies/packer.lua b/nvim/.config/nvim/lua/opdavies/packer.lua index 56d69f7..86438f1 100644 --- a/nvim/.config/nvim/lua/opdavies/packer.lua +++ b/nvim/.config/nvim/lua/opdavies/packer.lua @@ -13,9 +13,9 @@ require('packer').startup(function() use 'machakann/vim-highlightedyank' use 'miyakogi/seiya.vim' use 'norcalli/nvim-colorizer.lua' + use 'numToStr/Comment.nvim' use 'nvim-lua/plenary.nvim' use 'nvim-lua/popup.nvim' - use 'preservim/nerdcommenter' use 'sheerun/vim-polyglot' use 'tpope/vim-surround' use 'vim-test/vim-test' @@ -34,7 +34,6 @@ require('packer').startup(function() use 'ThePrimeagen/harpoon' -- Treesitter - use 'JoosepAlviste/nvim-ts-context-commentstring' use { 'nvim-treesitter/nvim-treesitter', run = ':TSUpdate', diff --git a/nvim/.config/nvim/plugin/packer_compiled.lua b/nvim/.config/nvim/plugin/packer_compiled.lua index 0cdc5f4..fcd55a0 100644 --- a/nvim/.config/nvim/plugin/packer_compiled.lua +++ b/nvim/.config/nvim/plugin/packer_compiled.lua @@ -57,7 +57,7 @@ end time([[Luarocks path setup]], false) time([[try_loadstring definition]], true) local function try_loadstring(s, component, name) - local success, result = pcall(loadstring(s)) + local success, result = pcall(loadstring(s), name, _G.packer_plugins[name]) if not success then vim.schedule(function() vim.api.nvim_notify('packer.nvim: Error running ' .. component .. ' for ' .. name .. ': ' .. result, vim.log.levels.ERROR, {}) @@ -69,6 +69,11 @@ end time([[try_loadstring definition]], false) time([[Defining packer_plugins]], true) _G.packer_plugins = { + ["Comment.nvim"] = { + loaded = true, + path = "/home/opdavies/.local/share/nvim/site/pack/packer/start/Comment.nvim", + url = "https://github.com/numToStr/Comment.nvim" + }, LuaSnip = { loaded = true, path = "/home/opdavies/.local/share/nvim/site/pack/packer/start/LuaSnip", @@ -134,11 +139,6 @@ _G.packer_plugins = { path = "/home/opdavies/.local/share/nvim/site/pack/packer/start/lspkind-nvim", url = "https://github.com/onsails/lspkind-nvim" }, - nerdcommenter = { - loaded = true, - path = "/home/opdavies/.local/share/nvim/site/pack/packer/start/nerdcommenter", - url = "https://github.com/preservim/nerdcommenter" - }, ["nvim-cmp"] = { loaded = true, path = "/home/opdavies/.local/share/nvim/site/pack/packer/start/nvim-cmp", @@ -159,11 +159,6 @@ _G.packer_plugins = { path = "/home/opdavies/.local/share/nvim/site/pack/packer/start/nvim-treesitter", url = "https://github.com/nvim-treesitter/nvim-treesitter" }, - ["nvim-ts-context-commentstring"] = { - loaded = true, - path = "/home/opdavies/.local/share/nvim/site/pack/packer/start/nvim-ts-context-commentstring", - url = "https://github.com/JoosepAlviste/nvim-ts-context-commentstring" - }, ["nvim-web-devicons"] = { loaded = true, path = "/home/opdavies/.local/share/nvim/site/pack/packer/start/nvim-web-devicons",