cmp-comment is a custom source plugin for nvim-cmp that provides completion suggestions for comments in Neovim.
Thank you for considering supporting this project! Your generosity helps keep development active and ensures the plugin continues to improve.
- Suggests predefined phrases for comments, such as
TODO:,FIXME:, and more. - Uses Tree-sitter to detect if the cursor is inside a comment.
Using lazy.nvim
Add the following to your Neovim configuration:
{
'walkingshamrock/cmp-comment',
dependencies = {
'nvim-treesitter/nvim-treesitter',
'hrsh7th/nvim-cmp',
},
config = function()
require('cmp').setup {
sources = {
{ name = 'comment' },
},
}
end
}- Place the cursor inside a comment.
- Trigger completion (e.g.,
<C-Space>). - Suggestions will appear based on predefined phrases.
You can customize the suggestions provided by cmp-comment by calling the setup function in your Neovim configuration. For example:
require("cmp_comment").setup({
suggestions = {
"Custom TODO: ",
"Custom FIXME: ",
"Custom NOTE: ",
}
})If no custom suggestions are provided, the plugin will use its default suggestions.
Contributions are welcome! If you encounter any issues or have suggestions for improvements, feel free to open an issue or submit a pull request on the GitHub repository.
This project is licensed under the MIT License. See the LICENSE file for details.