2022-11-03 02:33:54 +00:00
|
|
|
# NVim QuickComment
|
|
|
|
|
2022-11-03 04:24:51 +00:00
|
|
|
[![Quick comment demo](https://github.com/Stephen-Seo/nvim-quickcomment/raw/main/images/quickcomment.gif)](https://github.com/Stephen-Seo/nvim-quickcomment)
|
|
|
|
|
2022-11-03 04:12:26 +00:00
|
|
|
Quickly comment lines in a file with a single command.
|
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
|
|
|
Create the directory structure `${HOME}/.config/nvim/pack/plugins/start/` and
|
|
|
|
place `nvim-quickcomment/` in `start/`, or use a plugin manager.
|
|
|
|
|
2022-11-03 02:33:54 +00:00
|
|
|
## Usage
|
|
|
|
|
|
|
|
Add the following to your init.lua (replace "q" with the key you want to map to):
|
|
|
|
|
|
|
|
vim.cmd('nmap q :lua vim.g.quickcomment_togglecommentline()<CR>')
|
|
|
|
vim.cmd('vmap q :luado vim.g.quickcomment_togglecommentline(linenr)<CR>')
|
|
|
|
|
|
|
|
Or in init.vim:
|
|
|
|
|
|
|
|
nmap q :lua vim.g.quickcomment_togglecommentline()<CR>
|
|
|
|
vmap q :luado vim.g.quickcomment_togglecommentline(linenr)<CR>
|