Skip to content

Instantly share code, notes, and snippets.

@aaronjanse
Last active September 7, 2024 20:27
Show Gist options
  • Select an option

  • Save aaronjanse/2a48bda73bae6bf5b7bfb0230ffdc189 to your computer and use it in GitHub Desktop.

Select an option

Save aaronjanse/2a48bda73bae6bf5b7bfb0230ffdc189 to your computer and use it in GitHub Desktop.
{
"key": "]",
"command": "cursorMove",
"args": {
"to": "nextBlankLine"
},
"when": "editorTextFocus && dance.mode == 'normal'",
},
{
"key": "shift+]",
"command": "cursorMove",
"args": {
"to": "nextBlankLine",
"select": true
},
"when": "editorTextFocus && dance.mode == 'normal'",
},
{
"key": "[",
"command": "cursorMove",
"args": {
"to": "prevBlankLine"
},
"when": "editorTextFocus && dance.mode == 'normal'",
},
{
"key": "shift+[",
"command": "cursorMove",
"args": {
"to": "prevBlankLine",
"select": true
},
"when": "editorTextFocus && dance.mode == 'normal'",
},
{
"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'"
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment