question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Default key binding for "dance.seek.askObject.inner" (alt+i) doesn't work on MacOS

See original GitHub issue

Due to https://github.com/microsoft/vscode/issues/41024, this key combination cannot be mapped on MacOS (as well as alt+`,e,n,u and possibly others)

I’ve remapped it to ctrl+i but I think the defaults should also be adjusted

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:3
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
zetashiftcommented, Aug 14, 2022

Oh that’s very nice, here is mine:

  "key": "m",
    "command": "dance.openMenu",
    "args": {
      "menu": {
        "items": {
          "i": {
            "text": "select inner object",
            "command": "dance.seek.askObject.inner"
          },
          "a": {
            "text": "select object",
            "command": "dance.seek.askObject"
          },
          "s": {
            "text": "surround around object",
            "command": "dance.openMenu",
            "args": {
              "menu": {
                "items": {
                  "(": {
                    "text": "(surround)",
                    "command": "dance.run",
                    "args": {
                      "input": "await replace((x) => '(' + x + ')')",
                      "commands": [
                        [
                          ".edit.insert",
                          { "where": "start", "shift": "extend", "text": "(" }
                        ],
                        [
                          ".edit.insert",
                          { "where": "end", "shift": "extend", "text": ")" }
                        ]
                      ]
                    }
                  },
                  "{": {
                    "text": "{surround}",
                    "command": "dance.run",
                    "args": {
                      "input": "await replace((x) => '{' + x + '}')",
                      "commands": [
                        [
                          ".edit.insert",
                          { "where": "start", "shift": "extend", "text": "{" }
                        ],
                        [
                          ".edit.insert",
                          { "where": "end", "shift": "extend", "text": "}" }
                        ]
                      ]
                    }
                  },
                  "[": {
                    "text": "[surround]",
                    "command": "dance.run",
                    "args": {
                      "input": "await replace((x) => '[' + x + ']')",
                      "commands": [
                        [
                          ".edit.insert",
                          { "where": "start", "shift": "extend", "text": "[" }
                        ],
                        [
                          ".edit.insert",
                          { "where": "end", "shift": "extend", "text": "]" }
                        ]
                      ]
                    }
                  },
                  "<": {
                    "text": "<surround>",
                    "command": "dance.run",
                    "args": {
                      "input": "await replace((x) => '<' + x + '>')",
                      "commands": [
                        [
                          ".edit.insert",
                          { "where": "start", "shift": "extend", "text": "<" }
                        ],
                        [
                          ".edit.insert",
                          { "where": "end", "shift": "extend", "text": ">" }
                        ]
                      ]
                    }
                  },
                  "\"": {
                    "text": "\"surround\"",
                    "command": "dance.run",
                    "args": {
                      "input": "await replace((x) => '\"' + x + '\"')",
                      "commands": [
                        [
                          ".edit.insert",
                          { "where": "start", "shift": "extend", "text": "\"" }
                        ],
                        [
                          ".edit.insert",
                          { "where": "end", "shift": "extend", "text": "\"" }
                        ]
                      ]
                    }
                  },
                  "'": {
                    "text": "'surround'",
                    "command": "dance.run",
                    "args": {
                      "input": "await replace((x) => `'` + x + `'`)",
                      "commands": [
                        [
                          ".edit.insert",
                          { "where": "start", "shift": "extend", "text": "'" }
                        ],
                        [
                          ".edit.insert",
                          { "where": "end", "shift": "extend", "text": "'" }
                        ]
                      ]
                    }
                  },
                  "`": {
                    "text": "`surround`",
                    "command": "dance.run",
                    "args": {
                      "input": "await replace((x) => '`' + x + '`')",
                      "commands": [
                        [
                          ".edit.insert",
                          { "where": "start", "shift": "extend", "text": "`" }
                        ],
                        [
                          ".edit.insert",
                          { "where": "end", "shift": "extend", "text": "`" }
                        ]
                      ]
                    }
                  }
                }
              }
            }
          },
          "d": {
            "text": "delete surround",
            "command": "dance.run",
            "args": {
              "input": "await replace((x) => x.slice(1, -1))",
              "commands": [
                ".selections.save",
                ".selections.reduce.edges",
                ".edit.delete",
                ".selections.restore"
              ]
            }
          }
        }
      }
    },
    "when": "editorTextFocus && dance.mode == 'normal'"
  },

2reactions
yyogocommented, Aug 14, 2022

@zetashift you could remap m i to dance.seek.askObject.inner e.g:

    {
        "key": "m i",
        "command": "dance.seek.askObject.inner",
        "when": "editorTextFocus && dance.mode == 'normal'"
    },

A more advanced approach would be to map m to a custom menu, see e.g https://github.com/71/dance/wiki/Mirror-menu

Read more comments on GitHub >

github_iconTop Results From Across the Web

Change the behavior of the modifier keys on Mac
Click Keyboard Shortcuts on the right, then select Modifier Keys in the list on the left. For each modifier whose default action you...
Read more >
How do I do Home and End in iterm2? - Apple Stack Exchange
Preferences->Keys: Remove the default key bindings in iterm for Home and End . This will cause Home ( fn + left arrow in...
Read more >
Visual Studio Code Key Bindings
Here you will find the complete list of key bindings for Visual Studio Code and how to ... This page lists out the...
Read more >
How to reset Visual Studio Code key bindings? - Stack Overflow
Version 1.34.0 seems to have the settings at a slightly different location: Click File > Preferences > Keyboard Shortcuts; There is a triple-dot...
Read more >
ZoR - River Thames Conditions - Environment Agency - GOV.UK
D18ge review, Cintiq companion hybrid mac, Sugared lips, Auckland orewa tides, Vx5400 backup assistant, Ptmd management las vegas, Cp12 requirements, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found