A simple Neovim plugin that makes working with lists a breeze! Whether youโre taking notes, making TODOs, or organizing your thoughts, this plugin helps you manage different types of lists with minimal effort.
org-list.mov
While this plugin was designed to complement nvim-orgmode, it works perfectly fine as a standalone plugin for managing lists in any text file.
โจ Features
- List Type Cycling: Quickly switch between different list formats:
- Plain text
- Bullet points (-)
- Numbered lists (1., 2., etc.)
- Checkboxes ([X])
- Smart Checkbox Management:
- Toggle checkboxes with a single keybind
- Parent checkboxes automatically update based on their childrenโs state
- Partial completion states ([-]) for nested lists
- Repeatable actions using vim-repeat (press . to repeat)
๐ Installation
Using lazy.nvim
{
"hamidi-dev/org-list.nvim",
dependencies = {
"tpope/vim-repeat", -- for repeatable actions with '.'
},
config = function()
require("org-list").setup({
-- your config here (optional)
})
end
}Using packer.nvim
use { "hamidi-dev/org-list.nvim", requires = { "tpope/vim-repeat", -- for repeatable actions with '.' }, config = function() require("org-list").setup() end }
โ๏ธ Configuration
The plugin works out of the box with sensible defaults, but you can customize it to your liking:
require("org-list").setup({ mapping = { key = "<leader>lt", -- nvim-orgmode users: you might want to change this to <leader>olt desc = "Toggle: Cycle through list types" }, checkbox_toggle = { enabled = true, -- NOTE: for nvim-orgmode users, you should change the following mapping OR change the one from orgmode. -- If both mapping stay the same, the one from nvim-orgmode will "win" key = "<C-Space>", desc = "Toggle checkbox state", filetypes = { "org", "markdown" } -- Add more filetypes as needed } })
๐ฎ Usage
Cycle Through List Types
- Place your cursor anywhere in a list
- Press
<leader>lt(or your custom mapping) - The entire list will cycle through different formats
- Press
.to repeat the cycle action on other lists (requires vim-repeat)
Toggle Checkboxes
- Place your cursor on a checkbox line
- Press
<C-Space>(or your custom mapping) - The checkbox will toggle between empty, checked, and partial states
- Press
.to repeat the toggle action on other checkboxes (requires vim-repeat)
๐ก Tips
- The plugin is smart enough to handle nested lists and maintain proper indentation
- Parent checkboxes automatically show:
- [X] when all children are checked
- [-] when some children are checked
- [ ] when no children are checked
- Works seamlessly with org-mode syntax and conventions
๐ค Contributing
Found a bug? Have a feature request? Feel free to:
- Open an issue
- Submit a pull request
- Start a discussion
All contributions are welcome!
๐ License
MIT License - feel free to use this in your own projects!