I have a very simple question which I can not resolve. I am new to Pycharm and Python and I am trying to code a class. However every while and then I need to go line-by line and change the indent of the code.
Is there a shortcut in Pycharm where I can add spaces (format the indent) in the begging of a multiple lines simultaneously without processing each line individually ?
Thanks in advance
To insert individual spaces, click on the beginning of the line, then use cmd (for Mac) or ctrl (for Windows) and click on the beginning of other lines. It's the same way as how you select multiple files at once. Now when you add a space in front, it will add to all the lines that you selected.
ctrl + shift + A => open pop window to select options, select to spaces to convert all tabs as space, or to tab to convert all spaces as tab.
To add a line after the current one, press Shift+Enter . PyCharm moves the caret to the next line. To add a line before the current one, press Ctrl+Alt+Enter . PyCharm moves the caret to the previous line.
“how to edit multiple lines in vs code” Code Answer'sWindows: Ctrl + Alt + Arrow Keys. Linux: Shift + Alt + Arrow Keys. Mac: Opt + Cmd + Arrow Keys.
Highlight/ select the lines you want indented, then press TAB
as often as needed until they reach the proper indent level.
You can remove spaces with SHIFT TAB
.
You can also use CTRL+ALT+I
to auto-indent the selection.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With