How can I easily indent a block in any textarea on OS X? 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.]


Into:

    [I want this to indent.
    For formatting.
    It's several lines.]
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'.