autolist.nvim
autolist.nvim copied to clipboard
User set keymaps
Hey, nice work. I love the checkbox feature from bullets.vim. What do you think about adding this?
Yeah that’s fine, just add it in the “please submit module ideas” issue so we don’t double up. Currently I’m just working on getting the base ordered and unordered list stable, but that will be pretty high priority.
just to confirm, an empty checkbox looks like [ ] content and a filled checkbox looks like [x] content?
on further inspection, an empty checkbox looks like - [ ] content and a filled checkbox looks like - [x] content?
So a list should be:
- [ ] todo1
- [ ] todo2
- [x] todo3
- [ ] todo4
Do you mind if it doesn't support 1. [ ] content, because it just adds unnecessary complication
checkboxes merged, test it out and tell what you think @namjul
Do you mind if it doesn't support 1. [ ] content, because it just adds unnecessary complication
I don't think I ever used this combination, so would not mind. But I would consider it part of the full-feature set.
Also what I am using is a way to toggle the checkbox. I would expose this as a help using-<Plug> mapping. Like https://github.com/gbprod/yanky.nvim does it.
A print has found its way into here https://github.com/gaoDean/autolist.nvim/blob/8e01f57a4d0b811e73ac53f03c86475ad7b7c4dd/lua/autolist/generic.lua#L97 :)
don't know if i understood your question, but use <c-r> to toggle the checkbox just like toggling a list
also thanks for the test catch
Also what I am using is a way to toggle the checkbox. I would expose this as a
help using-<Plug>mapping. Like https://github.com/gbprod/yanky.nvim does it.
Im not sure what you mean by a help using-<Plug>. Could you please explain?
don't know if I understood your question, but use
to toggle the checkbox just like toggling a list
yes that is what I meant but rather would use <leader>-x
I'm not sure what you mean by a help using-<Plug>. Could you please explain?
So I was thinking to expose a <Plug> mapping this way users can set the key mapping themself. like:
vim.keymap.set({"n"}, "<leader>-x", "<Plug>(AutolistToggleCheckbox)")
:help using-<Plug> refers to the help page.
I mean you can use config.invert_mapping, that mapping calls the function that toggles the list. I see what you mean, but for things like <c-t> which are built in mappings, it is a bit useless. Oh I just realised, you would want a toggle checklist for normal mode as well. Thanks.
Just a thought, with <Plug>, how would you only set the keymap for certain filetypes? Would the plugin have to check, or does the user put in an autocommand?
alright, there is an option for config.invert_normal_mapping, and ill think about the <Plug>.
Just a thought, with <Plug>, how would you only set the keymap for certain filetypes? Would the plugin have to check, or does the user put in an autocommand?
Have not thought about that. The plugin I use for keymaps has an open issue for that https://github.com/folke/which-key.nvim/issues/281. So the base assumption I had was that it is better when the user controlls setting keymaps. But I can see in this case that if the plugin handles it it would make sure that they only get applied on the correct filetypes, which simplifies things for users. Maybe we can have both. So people opt-in to let the plugin handle them and otherwise use the <Plug>(AutolistToggleCheckbox) mapping to do it themselfs (or reverse).
Hey, I have added a config option to have custom mappings. Will add to docs later, look for the new release later this week for changes.
look towards v1.5 for the new mapping changes
Any updates on exposing <Plug> functions for custom keybindings in WhichKey etc? I didn't see anything in the Readme for what I might include in WhichKey. Is there anywhere else that I might look?
Thanks again for a great plugin :)