Search code examples
pythonpycharm

How to delete tabs in pycharm


Im refactoring the code and want to delete tabs in almost hundred of line. It's python. To illustrate what I want to do here is initial code:

def func():
    a = x
    b = z
    f(x)
    # lines of code ...

Here I want to get this:

a = x
b = z
f(x) 
#lines of code without tabs

Is it possible to do it in pycharm cause manually it takes a lot of time?


Solution

  • Ignoring your function issue that others have mentioned in the comments, unindenting/untabbing many lines of code can be done in PyCharm by highlighting the text and pressing shift + tab.

    For interest, highlighting and pressing tab alone, adds a tab/indent.