HELP with tabs/indentation please :(


#1

I know this is a total nublet question to ask but here goes… in the Atom editor, how do i go about getting BACK into regular typing once i have nested strings in lines having had used the “tab” or whitespace indentation?

here’s a bit of an example for what i’m trying to figure out:

import sys, pyHook, pythoncom

def OKBE(event):
      print str(event.Ascii)

      print chr(event.Ascii)
***

Now… at this point (***) i want to be able to start a new line of code but NOT inside that nested group… but i can’t figure out what key lets me start a new line from the beginning rather than on the same indentation as all that other stuff :frowning:


#2

What about backspace?

Also, you should format your code with backticks (or selecting it and pressing the </> button in the editor).


#3

@DamnedScholar I think the OP wanted a one key solution¹. Beside, backspace only unindent of one position. Could be Shift+Home and type, of course, but still a bit clumsy.

Other solution: go to your settings, Editor, uncheck the Auto Indent check box… But you might want the auto indent most of the time, so that’s not a perfect solution.

¹ something like having editor:newline-no-indent or editor:newline-left-margin, and mapping Ctrl+Enter to it… I suppose one can make a script in init.coffee for this, but I am not used to that yet.


#4

If the print lines are indented with one tab, then only one backspace is necessary.


#5

Of course, but it works only in the given example. In the general case, you have an arbitrary level of indentation, hence my remark. Although often that’s what you want: one level less in indentation… OK, we are both right, I suppose. :stuck_out_tongue: