Google Colab: edit two lines at the same time

淺唱寂寞╮ 提交于 2021-02-06 15:32:10

问题


In my local jupyter-notebook i can edit mutliple lines of code at the same time: simply press ctrl + click at the respective lines. In google Colab that does not seem to work. Is this feature available somehow?

I work with Firefox on a Ubuntu 16.04.


回答1:


It's available. Instead of Ctrl + Click, please use

  • Alt + Click for Windows
  • Option + Click for MacOS

To select all occurrences of the current selection, please use

  • Ctrl + Shift + L for Windows
  • Command + Shift + L for MacOS



回答2:


(In Linux - Chromium, at least)

I managed to do block select but only on contiguous lines, not multi-cursor unfortunately.

Shift+Alt + Up/Down to select multiple lines. Now you can release Alt and use Left/Right to move to the sides. Whatever you do now will affect the whole block.

And, if you select one or more lines with Shift (doesn't need to be the whole content, this affects all the lines with cursor), and then release Shift and press Alt+Up/Down, you will move those lines altogether up/down



来源:https://stackoverflow.com/questions/60053748/google-colab-edit-two-lines-at-the-same-time

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!