CMD + Delete
In Minecraft on macOS, pressing option and backspace deletes a single character, and pressing command and backspace deletes a word. This is completely inconsistent with the native OS, so I fixed it:
Not only does CMD + Delete fix the macOS text behavior, it also expands Minecraft into a fully user-configurable text editing/navigation shortcut framework!
Important Context
- If you use this mod on Windows or Linux, and you don't use custom mappings, nothing will change from vanilla Minecraft.
- If you have any problems with this mod, please report them as Issues on GitHub. This mod is Open Source and Pull Requests are very much welcome! :)
NOTE:
CMD + Delete is available for NeoForge only on 1.21.1 with Sinytra Connector!
Custom Mappings
You can define your own custom mappings in configuration files with the location & name: <minecraft install>/config/cmd_delete/mappings/<id>.json. These allow you to customize the text navigation shortcut behavior in Minecraft for your own taste & configuration.
Examples
sample.json:
{
"fv": 2,
"inherits": "builtin:mac",
"meta": {
"name": "Example custom mapping",
"author": "Omegabird113",
"description": "This example demonstrates inheritance, patching, and more! Though, these keybinds are made up and people wouldn't use these most likely...",
"version": "2.1.0",
"id": "sample",
"systems": [
"mac", "windows", "linux"
]
},
"actions": {
"NAV_TEXT_START": [
{
"key": "up",
"superCommand": true,
"altOption": false,
"shift": false,
"enabled": false
},
{
"key": "e",
"superCommand": true
},
{
"key": "home"
}
]
}
}
mac.json:
{
"fv": 2,
"meta": {
"name": "Mac mappings",
"author": "Omegabird113",
"description": "This is actually a copy of the built-in macOS mappings for CMD + Delete 1.2.0!",
"version": "1.0.0",
"id": "mac",
"systems": ["mac"]
},
"actions": {
"NAV_TEXT_START": [
{"key": "up", "superCommand": true, "altOption": false, "shift": false}
],
"SEL_TEXT_START": [
{"key": "up", "superCommand": true, "altOption": false, "shift": true}
],
"NAV_TEXT_END": [
{"key": "down", "superCommand": true, "altOption": false, "shift": false}
],
"SEL_TEXT_END": [
{"key": "down", "superCommand": true, "altOption": false, "shift": true}
],
"NAV_LINE_LEFT": [
{"key": "left", "superCommand": true, "altOption": false, "shift": false}
],
"SEL_LINE_LEFT": [
{"key": "left", "superCommand": true, "altOption": false, "shift": true}
],
"NAV_LINE_RIGHT": [
{"key": "right", "superCommand": true, "altOption": false, "shift": false}
],
"SEL_LINE_RIGHT": [
{"key": "right", "superCommand": true, "altOption": false, "shift": true}
],
"NAV_WORD_LEFT": [
{"key": "left", "superCommand": false, "altOption": true, "shift": false}
],
"SEL_WORD_LEFT": [
{"key": "left", "superCommand": false, "altOption": true, "shift": true}
],
"NAV_WORD_RIGHT": [
{"key": "right", "superCommand": false, "altOption": true, "shift": false}
],
"SEL_WORD_RIGHT": [
{"key": "right", "superCommand": false, "altOption": true, "shift": true}
],
"DEL_LINE_LEFT": [
{"key": "backspace", "superCommand": true, "altOption": false}
],
"DEL_LINE_RIGHT": [
{"key": "delete", "superCommand": true, "altOption": false}
],
"DEL_WORD_LEFT": [
{"key": "backspace", "superCommand": false, "altOption": true}
],
"DEL_WORD_RIGHT": [
{"key": "delete", "superCommand": false, "altOption": true}
],
"SEL_TEXT_UP": [
{"key": "up", "superCommand": false, "altOption": false, "shift": true}
],
"SEL_TEXT_DOWN": [
{"key": "down", "superCommand": false, "altOption": false, "shift": true}
]
}
}
Features
Custom mappings can:
- You don't have to define every modifier combination, because key modifiers use wildcard expansion where any modifier not included is treated as
trueORfalse. - You don't have to memorize raw GLFW keycodes, as CMD + Delete provides support for using friendly keyname strings defined by it instead. If a keyname is not defined, you can still choose to use a raw GLFW keycode in your JSON.
- Inherit keybinds from the builtin mappings or other custom mappings by setting the top-level
inheritsvalue tocustom:<id>to inherit a custom JSON, orbuiltin:<id>or just<id>to inherit a builtin JSON. - They can patch & override the mappings they inherit by setting the keybind to have
enabledproperty asfalse. Note that CMD + Delete always removes your disabled keybinds before adding your enabled keybinds, allowing a patch-then-reimplement pattern to be easily done.
Note that:
- The format version
fvis currently2and your mappings should match that. - The
meta.idfield must exactly match the filename
The /navmappings command
CMD + Delete includes an in-game, client /navmappings command for checking, switching, importing, exporting, and debugging mappings without manually touching config files.
Here are all the subcommands:
/navmappings info: displays info about the currently loaded mappings./navmappings list: displays a list of the namespaced IDs of the currently available mappings, which you could switch to./navmappings set default: switch to the default mappings behavior./navmappings set builtin <non-namespaced id>: switch a specific OS's builtin mappings JSON./navmappings set custom <non-namespaced id>: switch to one of your own custom mappings JSONs./navmappings reload: reload the currently active mappings./navmappings export <type> <non-namespaced id> <absolute location>: make a copy of a mappings JSON to another location on your system so you can copy it./navmappings import <non-namespaced id> <absolute location>: import a copy of a JSON you made from another location on your system into the custom JSONs folder for you to use as custom mappings./navmappings debug: a utility that provides dumps of information like info about CMD + Delete, a dump of the friendly keynames which CMD + Delete mappings JSONs support, or a raw dump of the internal loaded mappings' registry.
Builtin Mappings' Shortcuts
By default, CMD + Delete will detect if you're using macOS, and if you are it'll set you to those shortcuts, otherwise it will set you to use Windows/Linux shortcuts.
| Action | macOS | Windows / Linux |
|---|---|---|
| Delete previous word | option + backspace | ctrl + backspace |
| Delete next word | option + delete | ctrl + delete |
| Delete to start of line | cmd + backspace | N/A |
| Delete to end of line | cmd + delete | N/A |
| Move to previous word | option + ← | ctrl + ← |
| Move to next word | option + → | ctrl + → |
| Move to start of line | cmd + ← | home |
| Move to end of line | cmd + → | end |
| Move to start of text | cmd + ↑ | ctrl + home |
| Move to end of text | cmd + ↓ | ctrl + end |
| Select to previous word | option + shift + ← | ctrl + shift + ← |
| Select to next word | option + shift + → | ctrl + shift + → |
| Select to start of line | cmd + shift + ← | shift + home |
| Select to end of line | cmd + shift + → | shift + end |
| Select to start of text | cmd + shift + ↑ | ctrl + shift + home |
| Select to end of text | cmd + shift + ↓ | ctrl + shift + end |
| Select up one line | shift + ↑ | shift + ↑ |
| Select down one line | shift + ↓ | shift + ↓ |

