OpenSmallworld magik-vscode unbindings
December 8, 2025 VSCode OpenSmallworld magik-vscode
Sometimes you’re forced to use the magik-vscode VSCode extension. (You’d rather want to use magik-tools extension of course!) It’s generally a better experience than emacs, in my opinion, but the extension has some annoying key bindings.
VSCode and its ecosystem of extensions generally provide a standard key binding pattern such that the same key bindings call the same functionality in other languages. A clear example of this is the F2 key, which is used to rename symbols. This works the same for Python, Java, TypeScript, … Except for the magik-vscode extension. It binds F2 z to starting a new Smallworld session (magik.startSession). Even worse is that the key binding isn’t limited to a magik editor, but makes the F2 z binding active in all of VSCode. So when you’re editing a Java file and press F2, nothing happens (or rather, VSCode is then waiting for a follow-up key to be pressed.)
There are multiple cases like this, where the magik-vscode extension overrides standard key bindings. Another example is ctrl+g, which is used to go to a specific line number. Or ctrl+b which normally toggles the (left) sidebar, but magik-vscode binds this to opening the class browser.
To not pollute your environment, you can do two things. One is to disable the extension when you’re not using it. This requires one to enable it when developing in Smallworld and disable it when finished. Two actions which one might forget very easily. And this does not work when working on a project which uses both Magik and another language such as Java.
Another option is to change the key bindings. In VSCode, you can remove keyboard shortcuts. You can (also) do this via a JSON file. See keybindings.json for a JSON file which unbinds all the keyboard bindings added by the magik-vscode extension. Hopefully this makes your development experience a bit better again.
For completeness, here is the the JSON file as well:
// Unbind all keybindings added by the GE Smallworld Magik extension.
// ge-smallworld.magik-vscode 0.2.6
[
{
"key": "alt+oem_period",
"command": "-editor.action.revealDefinition",
"when": "editorHasDefinitionProvider && editorTextFocus && !isInEmbeddedEditor && editorLangId != 'magik'"
},
{
"key": "alt+right",
"command": "-editor.action.revealDefinition",
"when": "editorHasDefinitionProvider && editorTextFocus && !isInEmbeddedEditor && editorLangId != 'magik'"
},
{
"key": "alt+oem_comma",
"command": "-editor.action.goToReferences",
"when": "editorHasDefinitionProvider && editorHasReferenceProvider && editorTextFocus && !inReferenceSearchEditor && !isInEmbeddedEditor"
},
{
"key": "ctrl+b",
"command": "-magik.classBrowser"
},
{
"key": "ctrl+alt+m",
"command": "-magik.compileExtensionMagik"
},
{
"key": "ctrl+f7",
"command": "-magik.compileFile",
"when": "editorTextFocus"
},
{
"key": "f7",
"command": "-magik.compileMethod",
"when": "editorTextFocus"
},
{
"key": "f7",
"command": "-magik.compileMessages",
"when": "editorTextFocus && editorLangId == 'message'"
},
{
"key": "f8",
"command": "-magik.compileSelection",
"when": "editorTextFocus"
},
{
"key": "shift+alt+f",
"command": "-magik.formatFile",
"when": "editorTextFocus && editorLangId == 'magik'"
},
{
"key": "alt+f",
"command": "-magik.formatRegion",
"when": "editorTextFocus && editorLangId == 'magik'"
},
{
"key": "f3",
"command": "-magik.goto",
"when": "editorTextFocus"
},
{
"key": "alt+oem_period",
"command": "-magik.goto",
"when": "editorTextFocus && editorLangId == 'magik'"
},
{
"key": "alt+right",
"command": "-magik.goto",
"when": "editorTextFocus && editorLangId == 'magik'"
},
{
"key": "f3",
"command": "-magik.gotoClipboardText",
"when": "terminalFocus"
},
{
"key": "alt+pagedown",
"command": "-magik.gotoNextDefinition",
"when": "editorTextFocus"
},
{
"key": "alt+oem_6",
"command": "-magik.gotoNextDefinition",
"when": "editorTextFocus"
},
{
"key": "alt+pageup",
"command": "-magik.gotoPreviousDefinition",
"when": "editorTextFocus"
},
{
"key": "alt+oem_4",
"command": "-magik.gotoPreviousDefinition",
"when": "editorTextFocus"
},
{
"key": "ctrl+shift+i",
"command": "-magik.indentFile",
"when": "editorTextFocus"
},
{
"key": "ctrl+i",
"command": "-magik.indentRegion",
"when": "editorTextFocus"
},
{
"key": "alt+enter",
"command": "-magik.indentToLine",
"when": "editorTextFocus"
},
{
"key": "ctrl+shift+f7",
"command": "-magik.loadModule",
"when": "editorTextFocus && editorLangId == 'magik'"
},
{
"key": "alt+n",
"command": "-magik.newBuffer"
},
{
"key": "alt+e",
"command": "-magik.newConsole"
},
{
"key": "alt+t",
"command": "-magik.refreshSymbols"
},
{
"key": "alt+m",
"command": "-magik.refreshSymbols"
},
{
"key": "alt+f7",
"command": "-magik.runTest",
"when": "editorTextFocus"
},
{
"key": "ctrl+alt+f7",
"command": "-magik.runTestClass",
"when": "editorTextFocus"
},
{
"key": "ctrl+t",
"command": "-magik.searchSymbols",
"when": "editorTextFocus && editorLangId == 'magik'"
},
{
"key": "ctrl+m",
"command": "-magik.searchSymbols"
},
{
"key": "alt+r",
"command": "-magik.selectRegion",
"when": "editorTextFocus"
},
{
"key": "f2 z",
"command": "-magik.startSession"
},
{
"key": "ctrl+oem_period",
"command": "-editor.action.peekDefinition",
"when": "editorHasDefinitionProvider && editorTextFocus && !inReferenceSearchEditor && !isInEmbeddedEditor"
},
{
"key": "ctrl+oem_comma",
"command": "-editor.action.referenceSearch.trigger",
"when": "editorHasDefinitionProvider && editorHasReferenceProvider && editorTextFocus && !inReferenceSearchEditor && !isInEmbeddedEditor"
},
{
"key": "alt+g",
"command": "-search.action.openInEditor",
"when": "editorTextFocus"
},
{
"key": "ctrl+g",
"command": "-workbench.action.findInFiles",
"when": "editorTextFocus"
},
{
"key": "ctrl+oem_3",
"command": "-workbench.action.terminal.focus",
"when": "editorTextFocus && terminalHasBeenCreated || editorTextFocus && terminalProcessSupported"
},
{
"key": "ctrl+oem_3",
"command": "-workbench.action.focusActiveEditorGroup",
"when": "terminalFocus"
},
{
"key": "alt+oem_3",
"command": "-workbench.action.terminal.toggleTerminal",
"when": "terminal.active"
}
]