echasnovski / mini.nvim

Library of 40+ independent Lua modules improving overall Neovim (version 0.8 and higher) experience with minimal effort
MIT License
5.02k stars 185 forks source link

mini.files: multiple mappings per action #879

Closed clvanbrandt closed 4 months ago

clvanbrandt commented 4 months ago

Contributing guidelines

Module(s)

mini.files

Description

For some context, I am frequently switching between Colemak (home split keyboard) and Qwerty (work computer) layouts. This makes having only one mapping for some actions a bit awkward. I have the arrows keys in their original position on a different keyboard layer and use them everywhere else so the muscle memory is deeply ingrained.

I'd like to be able to do something like this :

require("mini.files").setup({
  mappings = {
    go_in = {"l", "i", "<Right>"},
    go_in_plus = {"L", "I"},
    go_out = {"h", "m", "<Left>"},
    go_out_plus = {"H". "M"},
  },
})

I can deal without it but it would be nice to have.

I can also draft a PR if you want but I am not sure if this is something you'd be willing to add.

echasnovski commented 4 months ago

Thanks for the suggestion!

This is already possible via creating buffer-local variables in dedicated event see #534 and #409.