Everything is subject to change.
The end goal is to have language-agnostic support for adding useful comments to pieces of code. The main plugin (this repo) would expose useful functions for other plugins to provide language-specific comments.
The idea is to support adding basic text comments and LuaSnip snippets.
Requires nvim-treesitter
.
Using vim-plug
Plug 'ismaelpadilla/comment-helper.nvim'
Default config:
require('comment_helper').setup({
-- Enable luasnip snippets.
-- Set to true if you have LuaSnip installed.
luasnip_enabled = false,
-- If luasnip isn't supported and we receive a snippet as a comment,
-- attempt to turn it into text and insert it.
snippets_to_text = false,
-- Function to call after a comment is placed.
post_hook = nil
})
Add keybinding for commenting:
vim.api.nvim_set_keymap('n', '<leader>cl', '<cmd> lua require("comment_helper").comment_line()<CR>', {})