It is easy to indent a whole line.
Just highlight the whole line and press Tab
Go to the start of the line and press Tab
Click anywhere in the line and press Ctrl + ]
Now the problem is how to insert indent in the middle of the line.
And also, how to indent at the end of the line.
Example usage scenario:
# Hyperparameters
LENGTH = 10 # length of foo
TEMP = 20 # temperature of bar
IV = 99.99 # induction variability of foo bar
Concretely, we want:
# Hyperparameters
LENGTH = 10 # length of foo
TEMP = 20 # temperature of bar
IV = 99.99 # induction variability of foo bar
Or even better (in some cases):
# Hyperparameters
LENGTH = 10 # length of foo
TEMP = 20 # temperature of bar
IV = 99.99 # induction variability of foo bar
- Note that by pressing the Tab button however, we are actually calling auto-complete instead of indenting.
- Of course we can always manual align them by using spacebar, but then we will have to do this every time we tune the hyperparameters.
So, how to indent instead of auto-completing in Jupyter?
P.S. Yes, I am aware of print("\t"), copying the output and pasting the indent. But that is not desirable.