change comment plugin, update deps
This commit is contained in:
parent
981dc055e7
commit
70ecd62a91
3 changed files with 88 additions and 76 deletions
|
@ -1,26 +1,38 @@
|
|||
return {
|
||||
"preservim/nerdcommenter",
|
||||
dependencies = {
|
||||
{
|
||||
-- This will auto change the commentstring option in files that could have varying
|
||||
-- comment modes like in jsx/markdown/files with embedded languages
|
||||
"JoosepAlviste/nvim-ts-context-commentstring",
|
||||
init = function()
|
||||
-- skip backwards compatibility routines and speed up loading
|
||||
vim.g.skip_ts_context_commentstring_module = true
|
||||
end,
|
||||
config = function()
|
||||
require("ts_context_commentstring").setup({})
|
||||
end,
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
vim.g.NERDCreateDefaultMappings = 0
|
||||
vim.g.NERDDefaultAlign = "both"
|
||||
vim.g.NERDSpaceDelims = 1
|
||||
vim.cmd("filetype plugin on")
|
||||
end,
|
||||
keys = {
|
||||
{ "<leader>/", "<Plug>NERDCommenterToggle<cr>k", mode = { "n", "x" }, desc = "Toggle comments on line/selection" },
|
||||
},
|
||||
"numToStr/Comment.nvim",
|
||||
dependencies = {
|
||||
{
|
||||
-- This will auto change the commentstring option in files that could have varying
|
||||
-- comment modes like in jsx/markdown/files with embedded languages
|
||||
"JoosepAlviste/nvim-ts-context-commentstring",
|
||||
init = function()
|
||||
-- skip backwards compatibility routines and speed up loading
|
||||
vim.g.skip_ts_context_commentstring_module = true
|
||||
end,
|
||||
config = function()
|
||||
require("ts_context_commentstring").setup({})
|
||||
end,
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
require("Comment").setup({
|
||||
pre_hook = function()
|
||||
return vim.bo.commentstring
|
||||
end,
|
||||
mappings = {
|
||||
basic = false,
|
||||
extra = false,
|
||||
},
|
||||
})
|
||||
vim.cmd("filetype plugin on")
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
"<leader>/",
|
||||
"<Plug>(comment_toggle_linewise_visual)",
|
||||
'<ESC><CMD>lua require("Comment.api").locked("toggle.linewise")(vim.fn.visualmode())<CR>',
|
||||
mode = { "n", "x" },
|
||||
desc = "Toggle comments on line/selection",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue