kode-team/mastodon.nvim

Use of comma

pcoves opened this issue · 4 comments

pcoves commented

Hey there.

I'm the dude who asked about the use of commas on Mastodon: https://mamot.fr/@PacoVelobs/109579012592822444.

I think I did not think this through before asking.
I thought ,XX was too opinionated because , already has a meaning in (n)vim slang.
But in the end, I think defining any keymap for such a plugin might not be a good idea.

Take https://github.com/ThePrimeagen/harpoon for example.
All it does is expose a bunch of public functions through its public API.
And users have to pick whatever they want to integrate the features into their editor.

I think it's better for users to pick their preferences, and at the same time, better for plugin authors not to push users one way or the other.
For example, even if this plugin is about Mastodon and m would seem fitting at first, it'd rather keep <Leader>m for :make<CR> as I write code in nvim and a compile more than I toot.

So, yeah, there is no way to make everybody happy except by letting them pick their own preferences when it comes to keybindings IMHO.

malkoG commented

Oh. Nice to see you, again!

I agree with your opinion.

I think that , notation should be provided as a example for setting keymap, too.

How about giving option to everyone for setting their own keymap through config callback?
If having no customized configuration, Just give them all default configuration with , notation keymap.

I got heavy inspiration from here https://github.com/pwntester/octo.nvim#%EF%B8%8F-configuration
In octo.nvim, mappings provides option that how to setup keymap with their own functions

pcoves commented

If you really want to showcase some keymaps, I'd recommend using <Leader> as it is the standard (n)vim way of doing things.
But, you can also show people how to use , as the <Leader> key: vim.g.mapleader = "," first.
Not sure if it's any help though.

Again, this is a very personal opinion and I might be wrong according to someone else.
I think stacking plugins lead to keybindings collision.
Exposing an API and letting users choose is the only way plugins author can ensure everybody can use their work.
I'm sure octo is awesome, but it clearly pushes toward the use of <Space> as the <Leader> key and I'd need to remap every thing to make good use of it.
The good point here is the documentation shows the exposed function and one can remap everything from a single mapping entry.
Not ideal but far from unusable.

malkoG commented

Okay, I got it.

I will take a look for this issue within 2 weeks and I will make PR for this issue.