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
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
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
luacode we generate for creating mappings relies onvim.keymap.setwhich 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
custommode is for keymaps which declare their mode(s) (or use the default""within their attrs.mapsattribute set:Beta Was this translation helpful? Give feedback.
All reactions