ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 26 Jan 2012 13:12:18 +0100How to disable auto-indentation on text mode interface?https://ask.sagemath.org/question/8117/how-to-disable-auto-indentation-on-text-mode-interface/The auto-indentation feature is meant to be friendly, but it actually seriously messes up with copypasting bits of Sage or Python code from text files. Is there some way it can be disabled (ideally: reversibly disabled) so I can copy pre-indented text?Wed, 25 Jan 2012 13:44:36 +0100https://ask.sagemath.org/question/8117/how-to-disable-auto-indentation-on-text-mode-interface/Answer by kcrisman for <p>The auto-indentation feature is meant to be friendly, but it actually seriously messes up with copypasting bits of Sage or Python code from text files. Is there some way it can be disabled (ideally: reversibly disabled) so I can copy pre-indented text?</p>
https://ask.sagemath.org/question/8117/how-to-disable-auto-indentation-on-text-mode-interface/?answer=13196#post-id-13196I just learned something - it turns out you CAN do this very easily!
sage: def f(x):
....: return x^2
....:
sage: %autoindent
Automatic indentation is: OFF
sage: def f(x):
....: return x^2
....:
See the [IPython](http://ipython.org/ipython-doc/stable/interactive/reference.html#autoindent) documentation for more info, including some warnings. I'm not sure exactly what rc files Sage obeys for its own IPython.Thu, 26 Jan 2012 13:12:18 +0100https://ask.sagemath.org/question/8117/how-to-disable-auto-indentation-on-text-mode-interface/?answer=13196#post-id-13196