notebook icon indicating copy to clipboard operation
notebook copied to clipboard

Keyboard shortcut for multiline cursor

Open detly opened this issue 4 years ago • 17 comments

Multiline editing is currently possible by holding Alt and dragging the mouse to create a multiline cursor. I find this slow and imprecise. Could we also please have a keyboard shortcut to do this? For example, Sublime Text 3 uses Shift+Alt+(up or down arrows). I don't know what's possible with a browser based notebook though.

This is mentioned in a comment on issue #2527 but not responded to.

detly avatar Jul 12 '19 04:07 detly

Has any work been done on this?

joshuadanpeterson avatar Feb 22 '20 00:02 joshuadanpeterson

Why there is no shortcut for this?

mertyertugrul avatar Jun 04 '20 16:06 mertyertugrul

bump

jsr-p avatar Jun 19 '20 08:06 jsr-p

That would be incredibly useful!

vaknin avatar Jun 20 '20 13:06 vaknin

https://github.com/jupyter/notebook/issues/2527 its CMD+Click on macOS.

kirilzilla avatar Jul 03 '20 17:07 kirilzilla

#2527 its CMD+Click on macOS.

comment was for a keyboard shortcut, not a mouse shortcut

laughingrice avatar Jul 08 '20 04:07 laughingrice

Has there been any progress on this?

nickmccullum avatar Aug 13 '20 20:08 nickmccullum

If you need a multiline cursor for 20 lines, clicking to set up precise locations takes longer than not using the multiline cursor at all. Would it be possible to have a keyboard shortcut for it?

aldanor avatar Sep 05 '20 11:09 aldanor

Bumping this, it's a must-have feature in my opinion. Pressing Alt + up/down arrow to multiline edit is something I'm always lacking when writing code in Jupyter notebooks. As a developer I often find myself using Google Colab for smaller tasks just because of their awesome code editor and auto-completion. I feel that the two features that vanilla notebooks are missing right now are developer-level key bindings like the one proposed here, and an IntelliSense-like autocompletion similar to the ones in VS Code and Colab.

rsayn avatar Nov 26 '20 14:11 rsayn

I'll join the party. Missing this feature a lot, one of my most-used features in Jetbrains IDEs.

Note: I specifically mean the ability to create several cursors using only keyboard, e.g. CMD+ALT+Up/Down, without using the mouse.

tartakovsky avatar Jan 08 '21 13:01 tartakovsky

If you need a multiline cursor for 20 lines, clicking to set up precise locations takes longer than not using the multiline cursor at all. Would it be possible to have a keyboard shortcut for it?

I know this is not a solution to keyboard shortcut request, but meanwhile it is hopefully implemented, you can help yourself by using ctrl+alt and drag click to select multiple lines using mouse

matuusu avatar Mar 05 '21 11:03 matuusu

I'm getting a separate cursor for each cell. After execution of one cell the cursor does not move to other and when I click in the next cell the cursor appears in previous and present both cursor . Please help me fixing this.

rishavtraining avatar May 19 '21 13:05 rishavtraining

I'm getting a separate cursor for each cell. After execution of one cell the cursor does not move to other and when I click in the next cell the cursor appears in previous and present both cursor . Please help me fixing this.

Even I am getting this error. I am not able to find any solution to it.

farhan-naqvi avatar Jul 11 '21 06:07 farhan-naqvi

Farhan change the default browser of your jupyter notebook and the issue will be gone. Check out YouTube videos to change the browser. Hope this helps

rishavtraining avatar Jul 12 '21 01:07 rishavtraining

Farhan change the default browser of your jupyter notebook and the issue will be gone. Check out YouTube videos to change the browser. Hope this helps

Hey, I restored my factory settings of chrome and it worked. Anyways thanks a lot for your answer.

farhan-naqvi avatar Jul 12 '21 11:07 farhan-naqvi

Thanks @detly.

This is solved in JupyterLab and will be solved in the future Notebook v7 release.

For more information about this new release, checkout the Notebook v7 Enhancement Proposal.

Zsailer avatar Feb 03 '22 17:02 Zsailer

FYI I found a really annoying issue around multiline-select where the only solution seems to be changing "CodeJump" default setting to use "control" instead of "alt". Only once this has been changed does multiline select work (for me). image

GabeChurch avatar May 11 '22 01:05 GabeChurch