TkrA
TkrA

Reputation: 668

Comment/Uncomment multiple lines in JupyterNotebook hotkey

I was wondering, if there is a PRO way of commenting/removing multiline # comments in JupyterNotebooks.

# line1
# line2
# line3

Something like SHIFT + " for adding triple quotes.

Upvotes: 9

Views: 32194

Answers (10)

Markus W
Markus W

Reputation: 1493

on the Swiss keyboard it is: Ctrl + §

Upvotes: 0

questionto42
questionto42

Reputation: 9562

Just switch to US keyboard while coding. You only need to know the keys by heart. Then, you can press the US shortcut Ctrl+/ on this "US keyboard", it should be the next button left to the right shift button. Your country's keyboard will not play a role anymore.

Upvotes: 0

sangam wathore
sangam wathore

Reputation: 1

simply we can use the control + / (back slash) button to we can comment multiple lines at a time.

Upvotes: 0

aVral
aVral

Reputation: 133

for me, German keyboard layout: Ctrl + # works

Upvotes: 0

Nicolás Cuervo
Nicolás Cuervo

Reputation: 11

French keyboard

On a french Keyboard use CTRL+/

Upvotes: 0

Maiara Moreira
Maiara Moreira

Reputation: 11

For Portuguese keyboard is ctrl + ;

Upvotes: 1

Tiago Ribeiro
Tiago Ribeiro

Reputation: 11

For those with a Portuguese keyboard and Windows operating system, CTRL + ~ comments multiple lines.

Upvotes: 1

petezurich
petezurich

Reputation: 10194

On a German keyboard layout I use CMD + ? successfully.

Upvotes: 2

joaquin
joaquin

Reputation: 85613

For the big bunch of people that does not use an english keyboard, probably the adequate keys are in other place. In the case of a Spanish Keyboard, I can comment/uncomment lines using "Ctrl + }"

enter image description here

Upvotes: 7

Anj
Anj

Reputation: 157

CTRL+/ for comment and uncomment multiple lines you can press 'h' anywhere in command mode, you can find all the shortcuts of jupyter.

Upvotes: 13

Related Questions