Open StitiFatah opened 8 months ago
Should work ootb as per the README
No it shouldn't, and the readme clearly lists steps to make it work for all popular commenting plugins.
As I understand the author, Defaults work out of the box.
means that it works without requiring .setup()
call as many plugins do and sets up the default config automatically.
Hey! The set up instructions are a little bit out of date, it looks like. It used to be that Comment.nvim and mini.comment only used the commentstring
setting when commenting, but they now have some extra logic. Comment.nvim doesn't use commentstring
by default but has its own logic. Mini.nvim uses Treesitter (if available) to get the commentstring
of the corresponding filetype, not the buffer's commentstring
option that this plugin sets.
This means that it won't work OOTB with these plugins like it does with the native Neovim commenting, for example. I improved the setup docs a little bit here: https://github.com/JoosepAlviste/nvim-ts-context-commentstring/commit/6b5f95aa4d24f2c629a74f2c935c702b08dbde62. How does it look now?
Also, I was thinking of moving away from the autocmd approach to the approach discussed here: https://github.com/JoosepAlviste/nvim-ts-context-commentstring/issues/109. I think that that might make the initial set up of the plugin a bit easier.
Minimal reproducible full config
https://github.com/nvim-lua/kickstart.nvim/blob/master/init.lua + add
'JoosepAlviste/nvim-ts-context-commentstring'
insiderequire('lazy').setup({})
Description
The README says that it works ootb, I tried with comment.nvim and mini.comment and it didn't. I had to add this configuration to
mini.comment
:and this to
comment.nvim
:Steps to reproduce
'JoosepAlviste/nvim-ts-context-commentstring'
torequire('lazy').setup({})
.tsx
file just adds the classic js//
Expected behavior
Should work ootb as per the README
Actual behavior
Doesn't work ootb