diff --git a/lua/config/comment.lua b/lua/config/comment.lua new file mode 100644 index 0000000..9edf0e0 --- /dev/null +++ b/lua/config/comment.lua @@ -0,0 +1,9 @@ +local config = {} + +if packer_plugins['nvim-ts-context-commentstring'] and packer_plugins['nvim-ts-context-commentstring'].loaded then + config.hook = function() + require("ts_context_commentstring.internal").update_commentstring() + end +end + +require("nvim_comment").setup(config) diff --git a/lua/plugins.lua b/lua/plugins.lua index d1a2054..75150d6 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -83,8 +83,12 @@ local function usePlugins(use, use_rocks) -- Smooth smooth scrolling use 'psliwka/vim-smoothie' - -- Toggle comments - use 'tpope/vim-commentary' + -- Commenting + use { + 'terrortylor/nvim-comment', + config = [[require 'config.comment']], + requires = 'JoosepAlviste/nvim-ts-context-commentstring' + } -- Color code colorizer use { 'norcalli/nvim-colorizer.lua', config = [[require 'config.colorizer']] }