Global indent

Steven D'Aprano steve+comp.lang.python at pearwood.info
Sat Aug 23 04:12:07 EDT 2014


Seymore4Head wrote:

> Is there a way to indent everything again?
> 
> Say I have a while statement with several lines of code and I want to
> add a while outside that.  That means indenting everything.  Is there
> a global way to do that?

In kwrite, kate, geany, and any other sensible editor, you select the text
you want to indent and press the tab key.

If your editor is not sensible, it may replace the entire block of text with
a single tab. In that case, hit Ctrl-Z, or Undo from the Edit menu, and
your text will be returned. In that case, check the menu commands offered
by your editor, especially the Edit and Tools menu (if it has a Tools
menu). In kwrite, I find Indent and Unindent commands under Tools. In
geany, I find Increase Indent and Decrease Indent under Edit>Commands
submenu.

(In case your editor is not only not sensible, but out-and-out
microcephalic, I suggest you try it on a sample piece of text first, in
case it does not allow you to undo.)



-- 
Steven




More information about the Python-list mailing list