2

I have tried to copy/paste my code into my code editor on my MAC. However, it auto indents everything. Is there a way to un-indent multiple lines at once?

  • 7
    what is your editor? –  Oct 12 '12 at 06:47
  • 2
    This is not a programming question according to the FAQ. You should ask this on SuperUser (or read the manual of your editor), because it's not Python, it's your editor that does the indenting. – Tim Pietzcker Oct 12 '12 at 06:56

3 Answers3

1

This really depends on what's the editor you are using. If it's vi/vim, just type :set paste before pasting the code.

chuchao333
  • 121
  • 3
0

If you are using python IDLE just ctrl+H-> check Regular expression ->Enter ^\t -> Replace All .... done :).

  • This will mess up indentation everywhere else in the file... – Tim Pietzcker Oct 12 '12 at 07:04
  • @TimPietzcker:- This is weird, try using find and it shows starting indents but at replace all its removing everything...some sort of bug... –  Oct 12 '12 at 07:06
  • Is this IDE the one hat comes with macPython? Right now, I'm using an app called CodeRunner –  Oct 12 '12 at 07:07
0

Try command+[ or command+] after you've selected the lines That at least works for me in IDLE.

Atticus29
  • 237
  • 2
  • 3
  • 7
  • What is the IDLE? The one that comes with MacPython? –  Oct 12 '12 at 07:09
  • IDLE is one of the editors. http://www.python.org/getit/ Does that command+[ trick not work in your current editor? –  Oct 12 '12 at 07:12
  • Hmm, It just worked in my current editor, instead of Ctrl-c I used the copy function on pastebin, but I'm gonna use the other IDLE. Does it come with pygame? –  Oct 12 '12 at 07:18