kommentary
Neovim plugin to comment text in and out, written in lua. Supports commenting out the current line, a visual selection and a motion/textobject.
Install
Packer
use 'b3nj5m1n/kommentary'
Vim-Plug
Plug 'b3nj5m1n/kommentary'
Configuration
Configure unsupported language
Replace rust with the filetype you want to configure, the first field in the table with the prefix for single-line comments (A whitespace character gets added by default after a prefix and before a suffix) or false if the language doesn't support single-line comments, and the second field with a table containing the prefix and suffix for multi-line comments (including whitespace) or false if the language doesn't support multi-line comments.
require('kommentary.config').config["rust"] = {"//", {"/*", "*/"}}
Contributing
Any and all contributions are greatly appreciated!
Issues
If you found a bug or want to request a feature, pleases do so by raising an issue.
Pull Requests
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Make your changes
- Run the unit tests if you changed anything affected by them
- Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Please try your best to follow the style of the rest of the codebase, even though there's no official spec or linter for it.
Documentation
The code is heavily commented, functions are documented using LDoc.
You can build the documentation with this command:
ldoc .
Then you can access it from doc/index.html
Tests
There are unit tests available in the directory lua/test
, you'll need to have luaunit installed, then run:
cd ./lua/
lua test/test_util.lua
# You might need to specify the lua version because luaunit doesn't support the latest ones
# lua5.3 test/test_util.lua
# For verbose output (Which tests are being run)
# lua test/test_util.lua -v
Or to run all tests:
cd ./lua/
./run_tests.sh