Skip to content

EvgeniGenchev/comment-nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

comment-nvim

a simple lua script to help you comment and uncomment faster

output

Features

  • Single line comment/uncomment
  • Visual mode multi-line comment/uncomment
  • Detecting languages and using the correct comment sign
  • Remapable keymap shortcuts available

Setup

Plug 'EvgeniGenchev/comment-nvim'
use({
  'EvgeniGenchev/comment-nvim',
})

Usage

-- include the package in your init.lua
require('comment').setup()

Customize

You can change the shortcuts of the commands.

-- Change the default singleline comment
vim.api.nvim_set_keymap('n', '?', ':Comment<CR>', {noremap=true, silent=false})

-- Change the visual mode multiline comment
vim.api.nvim_set_keymap('v', '?', ':CommentMore<CR>', {noremap=true, silent=false})

Also you can add other languages when you require the plug-in in init.lua.

require('comment').setup({
	languages = {
		sh = "#",
		php = "//",
		java = "//",
	},
})

TODO

  • add support for spaces
  • add support for ranges in normal mod
  • add support for multiline comment signes

Copyright © 2023-present EvgeniGenchev

Releases

No releases published

Packages

No packages published

Languages