Skip to content

walkingshamrock/cmp-comment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

cmp-comment

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.

Buy Me A Coffee

Features

  • Suggests predefined phrases for comments, such as TODO:, FIXME:, and more.
  • Uses Tree-sitter to detect if the cursor is inside a comment.

Installation

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
}

Usage

  1. Place the cursor inside a comment.
  2. Trigger completion (e.g., <C-Space>).
  3. Suggestions will appear based on predefined phrases.

Configuration

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.

Requirements

Contributing

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.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages