Copy/paste a cell in Google Colab

Viewed 5647

This is got a be one of the most or the most silly question in all stack overflow! But how do you copy/paste a cell in a COLABORATORY notebook? There is a "copy cell" option, but not "paste cell" option. Whenever I try to paste there's this pop message "Use cmd +V to paste", but there is no paste at all!. In Jupyter is just "c" to copy and "v" to paste! This is one of the reasons I do not use COLAB at all. Thanks for your time!

2 Answers

Actually ctrl + V works for pasting on Google Colab in 2021 if you are using Chrome or Edge.

For Copying I use the Edit menu:

enter image description here

Alternatively you can use the context menu for copying:

enter image description here

The workaround is to change your Colab Keyboard shortcuts by

  1. Navigate to Tools > Keyboard shortcuts
  2. Assign:
    • "Copy cell or selection" to Cmd/Ctrl+M C (press Cmd/Ctrl+M then C)
    • "Cut cell or selection" to Cmd/Ctrl+M X
    • "Delete cell/selection" to Cmd/Ctrl+M D

Then you can press Cmd/Ctrl+M then C, X, or D to copy, cut, or delete a cell. This is not as good as the original jupyter notebook method but at least you can do it with just keyboard. enter image description here keyboard preferences

Related