Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Are there shortcut keys or another quick way to indent a text block at once in a normal text area on OS X?

So that I can easily turn:

[I want this to indent.
For formatting.
It's several lines.]


    [I want this to indent.
    For formatting.
    It's several lines.]
share|improve this question
up vote 4 down vote accepted

You want to edit text, and for that you need a text editor. There is (easy) native way in OS X to do these kind of text manipulations.

I personally use BBEdit/TextWrangler for these kind of codings. command]

You can also use Automator to create a Service and use sed/regex to do the 'hard' lifting: (and bind a keystroke to this Service)


sed 's/\(^.*\)/\ \ \ \ \1/g':

sed can be used to edit lines of text. In this line sed globally substitutes a match of 'the beginning of a line and everything that comes after it' with '4 spaces and that match'.

share|improve this answer
What about the Cocoa Text System, couldn't that be used to provide a custom shortcut for an indent command? – Daniel Beck Aug 1 '14 at 13:25
Nice thought, it might be possible to do that, though I have no clue how ;) It is a clean way to do it though. – CousinCocaine Aug 1 '14 at 13:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.