Adding Linux copy and paste keyboard shortcuts to macOS with Karabiner-Elements
Here is one for those using a conventional PC keyboard, like I do with my Mac Mini: setting up Linux-style copying and pasting keyboard shortcuts on macOS. Because there is no Insert key on a conventional Mac keyboard, the suggestion will not work for that setup, as I remembered when seeking to use it on an iMac for the sake of retaining Linux-compatible muscle memory.
Before going any further, I need to point out that I already have swapped the Left CMD and Left CTRL keys using the Karabiner-Elements app, into which the following code was imported as a complex mapping and saved. Thus, what is CMD below is CTRL in reality. That means that the result is that I have CTRL+Insert for copying and SHFT+Insert for pasting. Here then is the code that makes the new mappings work:
{
"description": "Cmd+Insert -> Cmd+C, Shift+Insert -> Cmd+V",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "insert",
"modifiers": { "mandatory": ["command"] }
},
"to": [
{ "key_code": "c", "modifiers": ["command"] }
]
},
{
"type": "basic",
"from": {
"key_code": "insert",
"modifiers": { "mandatory": ["shift"] }
},
"to": [
{ "key_code": "v", "modifiers": ["command"] }
]
}
]
}
The complexity above comes from the use of modifier keys like SHFT, especially when turning SHFT+Insert into CMD+V (CTRL+V as I have it set up using a predicate simple mapping for the CMD/CTRL pairing). Otherwise, things should be self-explanatory, and Karabiner-EventViewer allowed me to identify the keys to remap.
Please be aware that comment moderation is enabled and may delay the appearance of your contribution.