Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding spaces in multiple lines simultaneously - in Pycharm

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

like image 314
user1396713 Avatar asked Jul 18 '14 10:07

user1396713


People also ask

How do you add a space with multiple lines?

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.

How do you set a tab to 4 spaces in PyCharm?

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.

How do I use multiple lines in PyCharm?

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 do you edit multiple lines in Python?

“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.


1 Answers

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.

like image 135
Oleg Avatar answered Sep 24 '22 06:09

Oleg