How do I reconfigure keyboard shortcuts for copy and paste?

47,106

Solution 1

Various config things needed changing to get the results I wanted:

  • In Firefox, about:config
    ui.key.accelKey 18
    ui.key.menuAccessKey 17

    This makes the Alt+C, Alt+V and Alt+W the keyboard shortcuts for Firefox rather than the corresponding Ctrl keys.
  • In gnome-terminal, edit->keyboard shortcuts, turn off "Enable menu access keys", change the copy, paste, etc., to Alt+C, Alt+V, etc. (This may have been the default that I changed some time in the past.)
  • In .synergy-conf, remove alt = super, super = alt. Now, Alt on the Ubuntu keyboard is the Command key on the Mac. Now, I just use Alt instead of Win; no big deal. (The Unity window manager seems to "own" the Win key; it seemed the path of least resistance to just change my habit here... and the Alt key is more like the location of the Command key on the Mac.)
  • Disable "New Terminal - Alt-T" in system keyboard shortcuts so it can be used for "New Tab" in gnome-terminal and Firefox.

Thanks for the pointers... I'd forgotten about the Firefox about:config change I had made way back when, which was an essential piece to the puzzle.

Solution 2

Ctrl+C and Ctrl+V by default do not copy and paste in the Terminal. This is because Ctrl+C is a special command used (for decades) to interrupt a currently running process. The default instead is Shift+Ctrl+C and Shift+Ctrl+V.

If you want to, you change this by clicking Edit>Keyboard Shortcuts in your Terminal.

Solution 3

I also find annoying that the terminal shortcuts to copy and paste are different from what's used in the rest of the system. An alternative solution to the one you found is changing terminal shortcuts to Ctrl+c and Ctrl+v and changing the interrupt key by adding the following in ~/.bashrc:

stty intr ^b

Now to interrupt a program you've to type ctrl+b instead of ctrl+c, but you can go ahead and remap the terminal shortcuts. Once this is done, you can use consistently Ctrl+c, Ctrl+v to copy and paste text across the system.

To find what other control keys are already used to send terminal signals, check the output of stty -a.

Solution 4

If you want to use the Win key for copy/paste in Firefox on Linux, you can set it in about:config as follows:

ui.key.accelKey 91
Share:
47,106

Related videos on Youtube

Mike
Author by

Mike

Updated on September 18, 2022

Comments

  • Mike
    Mike over 1 year

    I've been looking all over the configuration menus and googling all over the web for how to configure keyboard shortcuts for Copy and Paste in the Unity window manager.

    Is there some hidden place somewhere to configure this?

    In Gnome Desktop on Lucid, I had it configured so that using the Ubuntu system keyboard/mouse, I could use Win+C/Win+V to copy and paste everywhere on the Gnome desktop, including in Firefox and gnome terminal; then when I moved the mouse to my Mac desktop*, the same keystrokes would copy and paste. I would really like to keep this consistency.

    Ctrl+C is obviously inappropriate as the "copy" key in any sort of terminal program. (Any Ctrl characters, actually.)

    * I am doing this by running Synergy server on Ubuntu, and the Synergy client on a Macbook.

    • Admin
      Admin about 13 years
      What exactly do you mean? Ctrl+C and Ctrl+V work for copy and paste, except in the Dash which is a bug. See pad.lv/736222 if that's what you were asking.
  • Jeremy Bicha
    Jeremy Bicha about 13 years
    Ah, that sounds like a bug. I think I had a similar problem. I worked around it by right-clicking and selecting copy. It might be a keyboard focus issue. So if you report the bug, I'd like to follow it too.
  • Jorge Castro
    Jorge Castro about 13 years
    @Mike welcome to ask ubuntu, the way the site works is that you improve your question and then people adapt their answers, so integrate your comments about your workflow right into your question, otherwise the information gets buried in the comments, thanks!
  • Craig S. Anderson
    Craig S. Anderson over 6 years
    Minor thing - I used Edit->Preferences->Shortcuts in Terminal, then click on 'Copy' (or 'Paste') and then enter the shortcut.
  • Ashton Honnecke
    Ashton Honnecke almost 5 years
    @JeremyBicha That's very definitely not a bug.
  • Ricardo
    Ricardo over 3 years
    In gnome-terminal > keyboard shortcuts sometimes the Win key is represented as Super and sometimes as Ctrl. Do you know how to setup Win+C to be a shortcut to "Copy" while Ctrl+C to remains the "interrupt" command?
  • Ricardo
    Ricardo over 3 years
    (FYI, I'm using Ubuntu 18_04 as a VMWare Fusion guest over macOS Catalina)