File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -213,6 +213,32 @@ require('kommentary.config').configure_language('typescriptreact', {
213213})
214214```
215215
216+ #### [ ` nvim-comment ` ] ( https://github.com/terrortylor/nvim-comment )
217+
218+ ` nvim-comment ` can easily be configured to trigger the ` commentstring ` updating
219+ logic before commenting.
220+
221+ First, disable the ` CursorHold ` autocommand of this plugin:
222+
223+ ``` lua
224+ require ' nvim-treesitter.configs' .setup {
225+ context_commentstring = {
226+ enable = true ,
227+ enable_autocmd = false ,
228+ }
229+ }
230+ ```
231+
232+ Then, configure ` nvim_comment ` to trigger the ` commentstring ` updating logic with
233+ its ` hook ` configuration:
234+
235+ ``` lua
236+ require (" nvim_comment" ).setup ({
237+ hook = function ()
238+ require (" ts_context_commentstring.internal" ).update_commentstring ()
239+ end ,
240+ })
241+ ```
216242
217243## More demos
218244
You can’t perform that action at this time.
0 commit comments