Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/duckdm/mdcheck.nvim
A neovim plugin to toggle, checking/unchecking, creating and removing markdown checkboxes
https://github.com/duckdm/mdcheck.nvim
checkbox markdown md neovim neovim-plugin nvim nvim-plugin
Last synced: 14 days ago
JSON representation
A neovim plugin to toggle, checking/unchecking, creating and removing markdown checkboxes
- Host: GitHub
- URL: https://github.com/duckdm/mdcheck.nvim
- Owner: duckdm
- License: mit
- Created: 2024-09-16T06:39:34.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-09-16T08:04:42.000Z (2 months ago)
- Last Synced: 2024-10-11T06:23:58.489Z (about 1 month ago)
- Topics: checkbox, markdown, md, neovim, neovim-plugin, nvim, nvim-plugin
- Language: Lua
- Homepage:
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
A simple neovim plugin to toggle checked states for checkboxes in markdown files.
# Installation
Example using lazy:
```lua
return {
'duckdm/mdcheck.nvim',
event = 'VeryLazy',
--- See default config for available options
opts = {},
keys = {
{ 'h', function()
if require('mdcheck').has_checkbox() then
require('mdcheck').toggle()
else
require('mdcheck').create()
end
end, { desc = 'Create or toggle checkbox' } },
},
}
```# Default config
```lua
--- Checkbox states
states = {
unchecked = "%[ %]",
in_progress = "%[~%]",
checked = "%[x%]"
},
--- If toggle should set checked instead of in progress from an unchecked state
toggle_checked_directly = false,
```# Available commands
| Command | Description |
| --- | --- |
| `MdCheckToggle` | Toggle the checkbox under the cursor |
| `MdCheckCheck` | Check the checkbox under the cursor |
| `MdCheckInProgress` | Set the checkbox under the cursor to in progress |
| `MdCheckUncheck` | Set the checkbox under the cursor to unchecked |
| `MdCheckCreate` | Create a checkbox under the cursor |
| `MdCheckRemove` | Remove the checkbox under the cursor |# Available methods
```lua
local mdcheck = require('mdcheck')--- toggle the checkbox under the cursor
mdcheck.toggle()--- check the checkbox under the cursor
mdcheck.check()--- set the checkbox under the cursor to in progress
mdcheck.in_progress()--- set the checkbox under the cursor to unchecked
mdcheck.uncheck()--- create a checkbox under the cursor
mdcheck.create()--- remove the checkbox under the cursor
mdcheck.remove()--- check if the line under the cursor has a checkbox
mdcheck.has_checkbox()```