-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This plugin doesn't set the comments
var.
#81
Comments
Hey! I also considered that at some point, but didn't really use any of the I wouldn't mind supporting it, though, as |
Had chatgpt do some research for me, and came up with the following function: function get_comments_for_filetype(ft)
-- Create a hidden buffer in the background
local temp_buf = vim.api.nvim_create_buf(true, true)
-- Set the desired filetype in the temporary buffer
vim.api.nvim_buf_set_option(temp_buf, 'filetype', ft)
-- Get the comments var from the temporary buffer
local comments = vim.api.nvim_buf_get_option(temp_buf, 'comments')
-- Delete the temporary buffer
vim.api.nvim_buf_delete(temp_buf, { force = true })
return comments
end You could also do something similar to this for the However if you're married to the idea of supporting them manually, you can find all |
From
:h comments
This plugin should also set the
comments
var. That way OG plugins like https://github.com/glts/vim-textobj-comment will also work.The text was updated successfully, but these errors were encountered: