priority of mappings
Currently there exists six type of mappings
- native mode
- default mappings
- global mappings
- buffer local mappings
- submode
- default mappings
- global mappings
- buffer local mappings
For each mode, the priority of mapping is as follow:
- default mappings < global mappings < buffer local mappings
So, what it will be the priority between mappings of native mode and of submode?
I think at least submode's one must have high priority compare to native mode's one for each type of mapping.
Close. Maybe reopen in future.
I believe submode.nvim should override all "native mode" keymaps. Currently, I have an issue with neo-tree because its buffer keymap takes precedence over submode's keymaps. I can't even perform an action—in my case, resizing—while focused on a window with the neo-tree buffer. This means I would have to assign keymaps for all buffers (as submode may not be activated within neo-tree buffer) and manually remove them when leaving.
In the future, someone might suggest a use case for calling buffer-specific keymaps without leaving submode, but I don't have one.
[!NOTE] If submode is active when a new buffer is added, you would also need to attach these keymaps to the buffer.
Some ideas:
- An option like
precedence_over='global'|'default'|'buffer'for a submode. - An option like
scope='global'|'default'|'buffer'for a specific keymap. - Defining filetypes that will use buffer-scoped keymaps (e.g.,
ft=neo-tree). - Overriding only if keymaps are explicitly defined over default ones.
mini.cluestyle: a fuction that enables triggers for a specific buffer.