Skip to content

Commit 7131f56

Browse files
Merge pull request #21 from jasonrhansen/nvim-comment
Add nvim-comment integration instructions
2 parents a38c220 + c773020 commit 7131f56

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)