Create a mapping for several modes at once. #576
Closed
GaetanLepage
started this conversation in
General
Replies: 3 comments
-
I feel that mapping as closely as possible to neovim is the right way to go, so I'm more for something like syntax "B" that seems to go in that direction. Optimally we should no even use the |
Beta Was this translation helpful? Give feedback.
0 replies
-
I would also prefer |
Beta Was this translation helpful? Give feedback.
0 replies
-
Dealt with in #605 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently, if you want to create a mapping for several modes, you need to duplicate it:
Of course, thanks to the flexibility of the nix language, you can do better. But still.
The
lua
code we generate for creating mappings relies onvim.keymap.set
which accepts as argument a list of modes.Hence, in lua, the above mappings would translate to this single line:
For me, it could be cool to be able to achieve a similar syntax in nixvim.
For instance:
Here are my questions for you nixvim users:
maps.custom.KEY = { mode = MODE(S); action = ACTION; ...}
.This
custom
mode is for keymaps which declare their mode(s) (or use the default""
within their attrs.maps
attribute set:Beta Was this translation helpful? Give feedback.
All reactions