Hi,
I see that man.kak declares a user mode:
https://github.com/mawww/kakoune/blob/74b6c20a0d19c9fcf2b30a93de1ff3b715151e65/rc/tools/man.kak#L133-L142
This is surprising to me, as user modes seem like they should remain in the user configuration. The name of this mode is also fairly simple, which could potentially lead to confusion on the user's side when they try to declare a mode with the same name, but are told it's already taken.
So my question is: are user modes not expected to be controlled entirely by the user? If not should we not declare more user modes in built-in scripts (as an intermediary between mappings and commands), if yes should we move this one to the wiki (or better, man.asciidoc)?
Thanks!
As a third-party plugin author, I like being able to include a user-mode, since it lets me present the plugin's functionality in an accessible way without stomping on the user's normal mappings, and without requiring them to read all the documentation and figure out for themselves which commands are most directly useful, and how to wire them together.
For example, kakoune-cargo includes a user mode that exposes its most important functionality, as does kak-lsp.
It seems reasonable that first-party plugins might want to do the same thing, although most of them aren't complex enough to need it... or maybe they are, and if they included user-modes I'd have learned about their useful extra features by now.
I did not remember man.kak did define a user mode, but I dont see a big issue with it, I think plugins should not map a user mode to a key themselves, however they are welcome to define a user mode that can be easily bound to a key by the user.
Alright, so should this be spread over to other scripts as well? If #3698 gets merged, that's going to create a lot of commands, and indexing them into a single user mode might be convenient.
XXX-mode), but I'm thinking it should drop the -mode to make the command to enter it more elegant:enter-user-mode man-mode → enter-user-mode man
enter-user-mode clipboard-mode → enter-user-mode clipboard
Most helpful comment
As a third-party plugin author, I like being able to include a user-mode, since it lets me present the plugin's functionality in an accessible way without stomping on the user's normal mappings, and without requiring them to read all the documentation and figure out for themselves which commands are most directly useful, and how to wire them together.
For example, kakoune-cargo includes a user mode that exposes its most important functionality, as does kak-lsp.
It seems reasonable that first-party plugins might want to do the same thing, although most of them aren't complex enough to need it... or maybe they are, and if they included user-modes I'd have learned about their useful extra features by now.