Keyboard Shortcuts

There are a few keyboard shortcuts that work in most places where you are editing Python code. Where it says "control-/" below that means hold down the control key, and hit the "/" key (or on the Mac, the "command" key and then "/").

control-/ : Comment or un-comment a group of selected lines. Very handy to temporarily comment out a set of lines so they don't run.

tab : bulk indent a set of lines (shift-tab does the reverse, un-indenting)

control-b : jump to the definition of selected word in PyCharm.

Cursor Controls - Handy!

There are a keystrokes which that have been used to move the cursor around on computer systems for a very long time. These keystrokes have been ported to newer environments, such as PyCharm and the command line. Many of these work in the browser too, so you can even use them when composing email. On the Mac, these use the control key, not the command key.

control-a : Move the cursor to the start of the line

control-e : Move the cursor to the end of the line

control-k : Delete (kill) all the text through the end of the line. Do it a second time to delete the next line. There's something satisfying about hammering away on ctrl-k to delete a few lines of text.

control-d : delete the char to the right of the

I first learned these keystrokes on the emacs editor in 1984, so it's funny that they now work in gmail.

 

Copyright 2020 Nick Parlante