Skip to content

ismaelpadilla/comment-helper.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

comment-helper.nvim

Linting and style checking

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.

Preview

Installation

Requires nvim-treesitter.

Using vim-plug

Plug 'ismaelpadilla/comment-helper.nvim'

Language-specific plugins:

Configuration

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
})

Usage

Add keybinding for commenting:

vim.api.nvim_set_keymap('n', '<leader>cl', '<cmd> lua require("comment_helper").comment_line()<CR>', {})

Releases

No releases published

Packages

No packages published

Languages