chore(nvim): switch to numToStr/Comment.nvim
This commit is contained in:
parent
141e4f7310
commit
2d9f2a995e
14
nvim/.config/nvim/after/plugin/comment.lua
Normal file
14
nvim/.config/nvim/after/plugin/comment.lua
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
require 'Comment'.setup {
|
||||||
|
padding = true,
|
||||||
|
|
||||||
|
opleader = {
|
||||||
|
line = 'gc',
|
||||||
|
block = 'gb',
|
||||||
|
},
|
||||||
|
|
||||||
|
mappings = {
|
||||||
|
basic = true,
|
||||||
|
extra = true,
|
||||||
|
extended = false,
|
||||||
|
},
|
||||||
|
}
|
|
@ -13,9 +13,9 @@ require('packer').startup(function()
|
||||||
use 'machakann/vim-highlightedyank'
|
use 'machakann/vim-highlightedyank'
|
||||||
use 'miyakogi/seiya.vim'
|
use 'miyakogi/seiya.vim'
|
||||||
use 'norcalli/nvim-colorizer.lua'
|
use 'norcalli/nvim-colorizer.lua'
|
||||||
|
use 'numToStr/Comment.nvim'
|
||||||
use 'nvim-lua/plenary.nvim'
|
use 'nvim-lua/plenary.nvim'
|
||||||
use 'nvim-lua/popup.nvim'
|
use 'nvim-lua/popup.nvim'
|
||||||
use 'preservim/nerdcommenter'
|
|
||||||
use 'sheerun/vim-polyglot'
|
use 'sheerun/vim-polyglot'
|
||||||
use 'tpope/vim-surround'
|
use 'tpope/vim-surround'
|
||||||
use 'vim-test/vim-test'
|
use 'vim-test/vim-test'
|
||||||
|
@ -34,7 +34,6 @@ require('packer').startup(function()
|
||||||
use 'ThePrimeagen/harpoon'
|
use 'ThePrimeagen/harpoon'
|
||||||
|
|
||||||
-- Treesitter
|
-- Treesitter
|
||||||
use 'JoosepAlviste/nvim-ts-context-commentstring'
|
|
||||||
use {
|
use {
|
||||||
'nvim-treesitter/nvim-treesitter',
|
'nvim-treesitter/nvim-treesitter',
|
||||||
run = ':TSUpdate',
|
run = ':TSUpdate',
|
||||||
|
|
|
@ -57,7 +57,7 @@ end
|
||||||
time([[Luarocks path setup]], false)
|
time([[Luarocks path setup]], false)
|
||||||
time([[try_loadstring definition]], true)
|
time([[try_loadstring definition]], true)
|
||||||
local function try_loadstring(s, component, name)
|
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
|
if not success then
|
||||||
vim.schedule(function()
|
vim.schedule(function()
|
||||||
vim.api.nvim_notify('packer.nvim: Error running ' .. component .. ' for ' .. name .. ': ' .. result, vim.log.levels.ERROR, {})
|
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([[try_loadstring definition]], false)
|
||||||
time([[Defining packer_plugins]], true)
|
time([[Defining packer_plugins]], true)
|
||||||
_G.packer_plugins = {
|
_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 = {
|
LuaSnip = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/home/opdavies/.local/share/nvim/site/pack/packer/start/LuaSnip",
|
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",
|
path = "/home/opdavies/.local/share/nvim/site/pack/packer/start/lspkind-nvim",
|
||||||
url = "https://github.com/onsails/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"] = {
|
["nvim-cmp"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/home/opdavies/.local/share/nvim/site/pack/packer/start/nvim-cmp",
|
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",
|
path = "/home/opdavies/.local/share/nvim/site/pack/packer/start/nvim-treesitter",
|
||||||
url = "https://github.com/nvim-treesitter/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"] = {
|
["nvim-web-devicons"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/home/opdavies/.local/share/nvim/site/pack/packer/start/nvim-web-devicons",
|
path = "/home/opdavies/.local/share/nvim/site/pack/packer/start/nvim-web-devicons",
|
||||||
|
|
Loading…
Reference in a new issue