feat(settings): add commands to insert em-dash and en-dash symbols

Due to me using alt+- and alt+shift+- as undo/redo, macOS's which are macOS' default keybindings for typing en-dash and em-dash, I need an alternative way to insert them when needed.

This solution uses a combo of the macros and aliases extensions to achieve it. It's a bit of a dirty hack, but works for now. At a later day I'll look for a solution that lets me define and add custom commands.
This commit is contained in:
2025-03-15 13:19:17 +00:00
parent ee4d5411e6
commit 91663ad00d

View File

@@ -453,17 +453,6 @@
},
//
// ===========================================================================
// MARK: Command aliases
// ===========================================================================
// Extension:
// - https://marketplace.visualstudio.com/items?itemName=ArturoDent.command-alias
//
"command aliases": {
"sortLines.sortLines": "sl", // Sort Lines - https://marketplace.visualstudio.com/items?itemName=Tyriar.sort-lines
"settings.cycle.commandCenter": "Toggle Command Center"
},
//
// ===========================================================================
// MARK: Settings Cycle
// ===========================================================================
// Extension:
@@ -485,12 +474,41 @@
],
//
// ===========================================================================
// MARK: Command aliases
// ===========================================================================
// Extension:
// - https://marketplace.visualstudio.com/items?itemName=ArturoDent.command-alias
//
"command aliases": {
"sortLines.sortLines": "sl", // Sort Lines - https://marketplace.visualstudio.com/items?itemName=Tyriar.sort-lines
"settings.cycle.commandCenter": "Toggle Command Center",
"macros.insertEmDash": "Insert Em Dash",
"macros.insertEnDash": "Insert En Dash"
},
//
// ===========================================================================
// MARK: Macros
// ===========================================================================
// Extension:
// - https://marketplace.visualstudio.com/items?itemName=ctf0.macros
//
"macros.list": {
"insertEmDash": [
{
"command": "type",
"args": {
"text": "—"
}
}
],
"insertEnDash": [
{
"command": "type",
"args": {
"text": ""
}
}
],
//
// cycleSpacing is a basic emulation Emacs' built-in cycle-spacing command.
// It doesn't actually cycle spacing, but it performs the first step which