Neovim plugin for comment mode.
I'm not a fan of default setting from Neovim that automatically insert the current comment leader after hitting <Enter>
, 'o'
or 'O'
.
Screen.Recording.2023-07-19.at.15.50.28.mov
I want to control this behaviour.
Install the plugin with your preferred package manager:
{ "didadadida93/comment-mode" }
--- Lua
{ "didadadida93/comment-mode" }
Once installed, call init
function to setup autocmd
and user command
. It also recommended to call init
function at the end of your init.lua
file.
-- init.lua
-- ...other configuration
require('comment-mode').init()
By default it will turn off the comment mode.
Screen.Recording.2023-07-19.at.18.55.39.mov
:ToggleCommentMode
vim.keymap.set('n', '<your keymap>', require('comment-mode').toggle_comment_mode, {})
comment-mode is also come with lualine component
sections = {
lualine_x = {
require('comment-mode').comment_mode_component,
},
}
Screen.Recording.2023-07-19.at.19.29.38.mov
vim.g.commentmode = true -- set comment mode `on` when starting nvim
All contribution are welcome! Open issue, pull request, etc.