64

I've been using mac for years, but prefer to do software development on windows. I'm really used to is using the folowing shortcuts on windows very much:

<CTRL>  + INSERT: Copy
<SHIFT> + INSERT: Paste
<SHIFT> + DELETE: Cut

Of late, I've taken to doing even my development work on the Mac. However, as a matter of habit, I'm missing these shortcuts very much. Actually, I find these a lot more convenient than COMMAND + (C/V/X) combo.

Is there a way to reassign these three shortcuts at least?

I've look all over the internet and in the "Keyboards" system preferences but I did not find anything.

PS: If you're wondering where I find the INSERT keys on a mac book pro, I use a wireless keyboard.

daviesgeek
  • 38,901
  • 52
  • 159
  • 203
Code Poet
  • 1,475

8 Answers8

80

This worked great for me to serve just the cut/paste/copy features I use so oftenenter image description here

  • 5
    This doesn't work very well in some apps such as Finder. The problem is that sometimes the Menu item is named "Copy 6 items" or Copy file.txt, and then it doesn't work – Mike Blandford Mar 26 '15 at 14:23
  • 5
    How do you figure out the names for shortcuts? where can i see all available ones? because in my os there is only show help menu and nothing more... no autocomplete on new shortcut dialog – vach May 18 '15 at 07:06
  • 1
    for copy paste its logical but for example CTRL + Back i dont know the name and want to change it to Command + Back – vach May 18 '15 at 07:06
  • 2
    This worked for me. Added bunch of commands from VSCode to mach windows shortcuts. – Eugene S. Dec 21 '19 at 02:30
  • Important to note that changes may not take effect until restarting an application. – nasch Feb 06 '20 at 20:38
  • 1
    In addition to them, add CTRL+A for Select All – Halil İbrahim Oymacı Oct 05 '20 at 17:29
  • Alone like this is does not work for me – Madeo Dec 19 '20 at 02:18
  • 1
    @HalilİbrahimOymacı I recommend against ctrl-A. If you're a heavy bash/zsh terminal user ctrl-A will remove the very useful "go to beginning of the line." It is standard on linux desktop systems to use shift + ctrl + <key>, which seems to solve this for me on MacOS. – Jason R Stevens CFA Jan 15 '21 at 15:45
  • It seems to be a great solution, but I cannot setup the Undo option with CTRL-z, it doesn't work – David Leal Mar 29 '21 at 23:00
  • @DavidLeal I did it just now and called Undo "Revert" – Fraïssé Jun 29 '21 at 05:52
  • 1
    I was switching the Control and Command keys, but this created issues inside of IntelliJ as it forces an emulated terminal which can not compensate for the command key in the .zshrc file. Using this method to over-ride the applications isn't perfect, but it seems to work in many cases so far. – doublespaces May 16 '22 at 17:24
  • To reach the screenshot shown in the answer: System Preferences: Keyboard: Shortcuts – Hem Aug 21 '22 at 23:18
  • Doesnt work for Select All in chrome – MohitC Sep 26 '22 at 08:42
27
System Preferences: Keyboard: Modifier Keys...

Then swap the Command and Control keys. This will change everything globally for all keyboard commands system-wide.

enter image description here

14

Try creating ~/Library/KeyBindings/ and saving a property list like this as DefaultKeyBinding.dict:

{
    "^\UF727" = copy:; // control-insert
    "$\UF727" = paste:; // shift-insert
    "^\UF728" = cut:; // control-delete
}

I don't have a keyboard with an insert key, so I couldn't test if the first two settings work. The last setting works for me though.

Edit: another option is to use Karabiner (formerly KeyRemap4MacBook):

<autogen>__KeyToKey__ KeyCode::PC_INSERT, VK_CONTROL | Modifierflag::NONE KeyCode::C, ModifierFlag::COMMAND_L</autogen>
<autogen>__KeyToKey__ KeyCode::PC_INSERT, VK_SHIFT | Modifierflag::NONE, KeyCode::V, ModifierFlag::COMMAND_L</autogen>
<autogen>__KeyToKey__ KeyCode::FORWARD_DELETE, VK_SHIFT | Modifierflag::NONE, KeyCode::X, ModifierFlag::COMMAND_L</autogen>
Lri
  • 105,117
  • 1
    Gave it a shot. It doesn't seem to work. Guess I'll have to get used to mac clipboard shortcuts. Thanks much. I'll try and read up on the links. First look, I didn't understand most of the things in these links :) – Code Poet Nov 27 '11 at 16:19
  • 4
    Created an account just to mod this up. KeyRemap4MacBook finally made me able to use ctrl/shift+ins/del on mac, this has really made my coding so much faster. I've dabbled with DoubleCommand, custom keymaps etc but this one just worked right out of the box. – Arne Jan 28 '14 at 09:22
  • 1
    @Arne Sadly the application stopped working with Sierra update. The KeyBindings file approach has never worked for me. – ficuscr Nov 17 '16 at 19:34
  • 1
    On a standard PC keyboard the code for the Ins key is F746 (not F727). Del is still F728 as mentioned in the answer. – friederbluemle Jan 26 '20 at 08:43
9

I use Ctrl-Ins, Shift-Ins, etc too.

The solution described is here, as well as remapping Home and End keys to be more Windows-like, e.g.

  • Open TextEdit under the Applications folder. If TextEdit was already open, create a new document using File->New. There should be a window labeled Untitled.
  • Select the text within the window below, copy it, and then paste it into your new TextEdit window.
  • In TextEdit, convert this to plain text (the default is rich text) by selecting Format->Make Plain Text.
  • Next, select File->Save... In the Save As dialog box, navigate to your home directory (look under PLACES on the left side for a house picture that has your name next to it). In your home directory, double-click on the Library folder.
    • If you don't see the Library folder, then press Cmd+Shift+G (or Ctrl+Shift+G) and in the Go to the folder: dialog type ~/Library and press Go button.
  • If you see a KeyBindings folder then double-click on it. If not, then double-click on Library folder first to select it, then on the New Folder button, name the new folder KeyBindings (with no space), and then double-click on it. Type DefaultKeyBinding.dict for the filename (at the top, in the Save As: field).
  • Uncheck If no extension is provided, use ".txt" checkbox at the bottom of the Save As: dialog, read the warning below and then click Save.
  • Warning: TextEdit will sometimes try to "help" you by appending a .txt extension to the filename. Make sure this doesn't happen. If asked to use a .txt extension, tell TextEdit to instead use .dict. It will not work if you use .txt. If you have trouble, see comment by Nathan below.
  • Before these changes take effect, you need to log out and then log back in.

The code to paste into ~/Library/KeyBindings/DefaultKeyBinding.dict file is this one:

/* ~/Library/KeyBindings/DefaultKeyBinding.Dict
This file remaps the key bindings of a single user on Mac OS X 10.5 to more closely
match default behavior on Windows systems.  This particular mapping assumes
that you have also switched the Control and Command keys already.

This key mapping is more appropriate after switching Ctrl for Command in this menu: Apple->System Preferences->Keyboard & Mouse->Keyboard->Modifier Keys...-> Change Control Key to Command Change Command key to Control This applies to OS X 10.5 and possibly other versions.

Here is a rough cheatsheet for syntax. Key Modifiers ^ : Ctrl $ : Shift ~ : Option (Alt) @ : Command (Apple)

: Numeric Keypad

Non-Printable Key Codes

Up Arrow: \UF700 Backspace: \U0008 F1: \UF704 Down Arrow: \UF701 Tab: \U0009 F2: \UF705 Left Arrow: \UF702 Escape: \U001B F3: \UF706 Right Arrow: \UF703 Enter: \U000A ... Insert: \UF727 Page Up: \UF72C Delete: \UF728 Page Down: \UF72D Home: \UF729 Print Screen: \UF72E End: \UF72B Scroll Lock: \UF72F Break: \UF732 Pause: \UF730 SysReq: \UF731 Menu: \UF735 Help: \UF746

NOTE: typically the Windows 'Insert' key is mapped to what Macs call 'Help'.
Regular Mac keyboards don't even have the Insert key, but provide 'Fn' instead, which is completely different. */

{ "\UF729" = "moveToBeginningOfLine:"; /* Home / "@\UF729" = "moveToBeginningOfDocument:"; / Cmd + Home / "$\UF729" = "moveToBeginningOfLineAndModifySelection:"; / Shift + Home / "@$\UF729" = "moveToBeginningOfDocumentAndModifySelection:"; / Shift + Cmd + Home / "\UF72B" = "moveToEndOfLine:"; / End / "@\UF72B" = "moveToEndOfDocument:"; / Cmd + End / "$\UF72B" = "moveToEndOfLineAndModifySelection:"; / Shift + End / "@$\UF72B" = "moveToEndOfDocumentAndModifySelection:"; / Shift + Cmd + End / "\UF72C" = "pageUp:"; / PageUp / "\UF72D" = "pageDown:"; / PageDown / "$\UF728" = "cut:"; / Shift + Del / "$\UF727" = "paste:"; / Shift + Ins / "@\UF727" = "copy:"; / Cmd + Ins / "$\UF746" = "paste:"; / Shift + Help / "@\UF746" = "copy:"; / Cmd + Help (Ins) / "@\UF702" = "moveWordBackward:"; / Cmd + LeftArrow / "@\UF703" = "moveWordForward:"; / Cmd + RightArrow / "@$\UF702" = "moveWordBackwardAndModifySelection:"; / Shift + Cmd + Leftarrow / "@$\UF703" = "moveWordForwardAndModifySelection:"; / Shift + Cmd + Rightarrow */ }

izogfif
  • 103
  • External links can go away. Please relate the most relevant contents here in your answer so the answer will always be here, and the link can serve for deeper research. – kmarsh Nov 10 '15 at 14:55
  • Ha, I forgot I even wrote this answer. I've probably repaved my Mac 5 times since I wrote it, and got used to the Mac shortcuts years ago. – Matt Frear Nov 11 '15 at 15:53
  • I think this is the most effective way to replicate Windows/Linux keyboard functionality on a Mac. Confirmed it still works as of 10.15.x. – etech Feb 24 '21 at 10:57
  • Confirmed it still works as of 12.6. However in some application (Firefox) the Ctrl+Insert does not copy selected text... – ino Oct 20 '22 at 18:31
4

System Preferences -> Keyboard -> Keyboard Shortcuts

You can change (or assign) several hotkeys by finding in the list and then clicking on the key assigned and then typing the new one to replace.

To replace (for example) a "copy" operation in a specific program add an entry for the program in you are using (or for all programs). In the menu title box, type EXACTLY the menu text of the item i (e.g. Copy) as the text. Restart the application and click on the menu item within the program, you will find that this has been replaced with your custom shortcut

osx86x
  • 814
1

I'm using keyboard maestro since

  1. swapping cmd and ctrl is not suitable for working with terminals. You actually need a lot of ctrl.
  2. changing it in system preferences doesn't work with some applications.

Copy: enter image description here

Undo: enter image description here

Paste enter image description here

Izana
  • 245
0

You can install and configure Karabiner app with the following configuration of private.xml file (edit in Misc tab):

<?xml version="1.0"?>
<root>
  <item>
    <name>Copy with Ctrl-Insert</name>
    <identifier>private.use_ctrl_insert_for_copy</identifier>
    <autogen>
        __KeyToKey__
        KeyCode::PC_INSERT, ModifierFlag::CONTROL_L,
        KeyCode::C, ModifierFlag::COMMAND_L
    </autogen>
  </item>
  <item>
    <name>Copy with Ctrl-C</name>
    <identifier>private.use_ctrl_c_for_copy</identifier>
    <autogen>
        __KeyToKey__
        KeyCode::C, ModifierFlag::CONTROL_L,
        KeyCode::C, ModifierFlag::COMMAND_L
    </autogen>
  </item>
  <item>
    <name>Cut with Shift-Delete</name>
    <identifier>private.use_shift_delete_for_cut</identifier>
    <autogen>
        __KeyToKey__
        KeyCode::DELETE, ModifierFlag::SHIFT_L,
        KeyCode::X, ModifierFlag::COMMAND_L
    </autogen>
  </item>
  <item>
    <name>Cut with Ctrl-X</name>
    <identifier>private.use_ctrl_x_for_cut</identifier>
    <autogen>
        __KeyToKey__
        KeyCode::X, ModifierFlag::CONTROL_L,
        KeyCode::X, ModifierFlag::COMMAND_L
    </autogen>
  </item>
  <item>
    <name>Paste with Shift-Insert</name>
    <identifier>private.use_shift_insert_for_paste</identifier>
    <autogen>
        __KeyToKey__
        KeyCode::PC_INSERT, ModifierFlag::SHIFT_L,
        KeyCode::V, ModifierFlag::COMMAND_L
    </autogen>
  </item>
  <item>
    <name>Paste with Ctrl-V</name>
    <identifier>private.use_ctrl_v_for_paste</identifier>
    <autogen>
        __KeyToKey__
        KeyCode::V, ModifierFlag::CONTROL_L,
        KeyCode::V, ModifierFlag::COMMAND_L
    </autogen>
  </item>
</root>

and enable newly created item after reloading the file in the Change Key tab.

Related: Remap Ctrl+C, Ctrl+V, and Ctrl-X only

kenorb
  • 12,695
-1

I can't make Karabiner Elements work for me for Sierra, no Insert key. I finally decided the issue is that I use my left hand to press modifier keys (ctrl, cmd, opt) and my right hand to press navigation keys (arrows, home, end, insert, delete). THAT'S WHY Cmd-C and Cmd-V are so awkward.

So I am experimenting with (through the System Keyboard Shortcuts above):

  • Cmd-[ for Copy
  • Cmd-[ for Paste
  • 1
    I'm having a hard time seeing how this is an actual answer and not commentary/feedback as to your trials/experiments.. – Allan Oct 05 '17 at 20:37