From f2432d6989fde5d7fbe9b10352830fe5fd45e65b Mon Sep 17 00:00:00 2001 From: andrzej Date: Tue, 25 Jun 2024 22:11:59 +0200 Subject: [PATCH] make jsx commentable --- nvim/.config/nvim/lua/plugins/comment.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/nvim/.config/nvim/lua/plugins/comment.lua b/nvim/.config/nvim/lua/plugins/comment.lua index 3f52a25..5b32e09 100644 --- a/nvim/.config/nvim/lua/plugins/comment.lua +++ b/nvim/.config/nvim/lua/plugins/comment.lua @@ -1,2 +1,13 @@ --this plugin allows commenting selections -return { "numToStr/Comment.nvim", opts = {} } +return { + "numToStr/Comment.nvim", + dependencies = { "JoosepAlviste/nvim-ts-context-commentstring" }, + config = function() + require("ts_context_commentstring").setup({ + enable_autocmd = false, + }) + require("Comment").setup({ + pre_hook = require("ts_context_commentstring.integrations.comment_nvim").create_pre_hook(), + }) + end, +}