Skip to content

Instantly share code, notes, and snippets.

@EdAyers
Last active August 26, 2021 14:41
Show Gist options
  • Save EdAyers/bc018025912b2315d244f28d707a0462 to your computer and use it in GitHub Desktop.
Save EdAyers/bc018025912b2315d244f28d707a0462 to your computer and use it in GitHub Desktop.
kak mirror emulation for vscode Dance
[
{
"key": "'",
"command": "dance.openMenu",
"args": {
"input": "mirror"
},
"when": "editorTextFocus && dance.mode == 'normal'"
},
]
{
"dance.menus": {
"mirror": {
"items": {
"l": {
"text": "character left",
"command": "dance.run",
"args": {
"commands": [
"dance.select.left.extend",
"dance.selections.changeDirection",
"dance.select.right.extend",
"dance.selections.changeDirection",
]
},
},
"h": {
"text": "character right",
"command": "dance.run",
"args": {
"commands": [
"dance.select.right.extend",
"dance.selections.changeDirection",
"dance.select.left.extend",
"dance.selections.changeDirection",
]
},
},
"j": {
"text": "line down",
"command": "dance.run",
"args": {
"commands": [
"dance.select.down.extend",
"dance.selections.changeDirection",
"dance.select.up.extend",
"dance.selections.changeDirection",
]
},
},
"k": {
"text": "line up",
"command": "dance.run",
"args": {
"commands": [
"dance.select.up.extend",
"dance.selections.changeDirection",
"dance.select.down.extend",
"dance.selections.changeDirection",
]
},
},
"(": {
"text": "(surround)",
"command": "dance.run",
"args": {
"commands": [
"dance.modes.insert.after",
{"command": "type", "args": {"text": ")"}},
"dance.modes.set.normal",
"dance.selections.save",
"dance.modes.insert.before",
{"command": "type", "args": {"text": "("}},
"dance.modes.set.normal",
"dance.selections.restore",
"dance.selections.changeDirection",
]
},
},
"{": {
"text": "{surround}",
"command": "dance.run",
"args": {
"commands": [
"dance.modes.insert.after",
{"command": "type", "args": {"text": "}"}},
"dance.modes.set.normal",
"dance.selections.save",
"dance.modes.insert.before",
{"command": "type", "args": {"text": "{"}},
"dance.modes.set.normal",
"dance.selections.restore",
"dance.selections.changeDirection",
]
},
},
"[": {
"text": "[surround]",
"command": "dance.run",
"args": {
"commands": [
"dance.modes.insert.after",
{"command": "type", "args": {"text": "]"}},
"dance.modes.set.normal",
"dance.selections.save",
"dance.modes.insert.before",
{"command": "type", "args": {"text": "["}},
"dance.modes.set.normal",
"dance.selections.restore",
"dance.selections.changeDirection",
]
},
},
"<": {
"text": "<surround>",
"command": "dance.run",
"args": {
"commands": [
"dance.modes.insert.after",
{"command": "type", "args": {"text": ">"}},
"dance.modes.set.normal",
"dance.selections.save",
"dance.modes.insert.before",
{"command": "type", "args": {"text": "<"}},
"dance.modes.set.normal",
"dance.selections.restore",
"dance.selections.changeDirection",
]
},
},
"\"": {
"text": "\"surround\"",
"command": "dance.run",
"args": {
"commands": [
"dance.modes.insert.after",
{"command": "type", "args": {"text": "\""}},
"dance.modes.set.normal",
"dance.selections.save",
"dance.modes.insert.before",
{"command": "type", "args": {"text": "\""}},
"dance.modes.set.normal",
"dance.selections.restore",
"dance.selections.changeDirection",
]
},
},
"'": {
"text": "'surround'",
"command": "dance.run",
"args": {
"commands": [
"dance.modes.insert.after",
{"command": "type", "args": {"text": "'"}},
"dance.modes.set.normal",
"dance.selections.save",
"dance.modes.insert.before",
{"command": "type", "args": {"text": "'"}},
"dance.modes.set.normal",
"dance.selections.restore",
"dance.selections.changeDirection",
]
},
},
"`": {
"text": "`surround`",
"command": "dance.run",
"args": {
"commands": [
"dance.modes.insert.after",
{"command": "type", "args": {"text": "`"}},
"dance.modes.set.normal",
"dance.selections.save",
"dance.modes.insert.before",
{"command": "type", "args": {"text": "`"}},
"dance.modes.set.normal",
"dance.selections.restore",
"dance.selections.changeDirection",
]
},
},
"d": {
"text": "delete surround",
"command": "dance.run",
"args": {
"commands": [
"dance.selections.save",
"dance.selections.reduce.edges",
"dance.edit.delete",
"dance.selections.restore",
]
},
},
}
}
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment