-
-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vim.maps rewrite #304
Comments
It would be cool if |
something like this maybe? vim.maps = {
"<leader>x" = [
{mode = ["n", "v"]; action = ":foo<CR>";}
{mode = "i"; action = "<cmd>bar<cr>";}
];
"<leader>y" = {mode = "c"; action = "...";}
}; |
ah yes, the infamous comma in a Nix list... |
what am I looking at |
@ppenguin I'm pretty sure there is a map mode whose short form is 2 characters, and besides, a list makes more sense, as that's used in the lua api too. |
heh I misread |
though the current rewrite has the problem of not being able to make different bindings for the same key on different modes (what I suggested) that aside, string (e.g. "nvc" for normal + visual + command) mode should work with this rewrite p.s. whoever thought comma-less list is good syntax deserves to stub their toe tonight |
Make vim.maps a list then, idk |
🏷️ Feature Type
Other
🔖 Feature description
The current implementation isn't great, because the implementation is messy, and it's not flexible, since the user can't specify modes.
✔️ Solution
My suggestion is very similar to the previous one, except binds are directly in
vim.maps
and there is a new mode attribute in their definition, eg.:(mode is of type
either str (listOf str)
)❓ Alternatives
No response
📝 Additional Context
This would still allow the user to have a very similar structure, eg.:
The text was updated successfully, but these errors were encountered: