[Question]
  [
When using Markup, like on the SE network, an indentation of four spaces before a line of text denotes it as part of a code block, as I hope you know. If you don't, here's an example (with `.` representing a space):
....Code  
....More code
results in
```
Code
More code
```
The problem is, when you copy-paste code into an answer, you need to indent each line manually. This is especially difficult when working with ungolfed code, as it's likely already indented and can cause confusion. You can just select your code and hit `Ctrl + K`, it turns out. Hours of my life wasted for no reason aside...
So, your goal is, **given an input, return it with four spaces before each line.** In the spirit of saving time copy-pasting, you are to process the entire input as a single string (so long as your language can parse it). If your language is unable to process a character (such as newlines) in strings, you may assume it is denoted/escaped through some other method supported by the language; however, the output must output each line on its own line (so no passing something like `....foo\n....bar`).
Standard loopholes not allowed. As this is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), the shortest answer in bytes wins. Good luck!
  
[Answer]
# [V](https://github.com/DJMcMayhem/V), 4 bytes
```
Î4É 
```
[Try it online!](https://tio.run/nexus/v#@3@4z@Rwp8L//x6ZXAq5lVwKCnmJualcCpnFXOn5@ek5qQA "V – TIO Nexus")
(Note the trailing space)
V is encoded in Latin1, where this is encoded like so:
```
00000000: ce34 c920                                .4. 
```
### Explanation
```
Î            " On every line
 4É<space>   " Prepend 4 spaces
```
---
Here's a solution that is also 4 bytes in UTF-8!
```
VG4>
VG          " Select everything
   >        " Indent
  4         " 4 times (with spaces)
```
[Answer]
# [Crayon](https://github.com/ETHproductions/crayon), 7 bytes
```
`¤q;3xq
```
[Try it online!](https://tio.run/nexus/crayon#@59waEmhtXFF4f///xOTkrlSUtMA "Crayon – TIO Nexus")
### Explanation
Crayon is a stack-based language designed for creating ASCII-art. It's still in the early stages of development, but it knows just enough to finish this challenge with a rather low byte count:
```
         Implicit: input string is on the stack
`¤       Push a non-breaking space to the stack.
  q;     Draw this at the cursor (0,0 by default) and pop it.
    3x   Move three more spaces to the right.
      q  Draw the input string here (at 4,0).
         Implicit: output the canvas, trimmed to a rectangle
```
Drawing the non-breaking space is necessary because Crayon automatically trims the output to a rectangle, so without the NBSP it would just print the original input.
[Answer]
## [Retina](https://github.com/m-ender/retina), 8 bytes
```
%`^
```
[Try it online!](https://tio.run/nexus/retina#@6@aEMelAAT//zvnp6Ry@eYXpSokA1kA "Retina – TIO Nexus")
There are four spaces on the second line. Alternative solutions use either `m`^` or `%1`` or `1%`` on the first line. All of these match the position at the beginning of each line and replace it with four spaces.
[Answer]
# Cheddar, 31 bytes
```
@.lines.map(("    ":+)).asLines
```
Really simply, but I posted because it shows off the new functional operators. 
`(" ":+)` is the same as `A -> " " + A`. (i.e. `+` op as a function with `" "` bound to LHS).
I don't think even needs explanation
[Answer]
# [Python](https://docs.python.org), ~~44~~ 39 bytes
Crossed out &nbsp;44&nbsp; is no longer 44 :)
-5 bytes thanks to ovs (avoid dequeue with a prepend)
```
lambda s:' '*4+s.replace('\n','\n    ')
```
**[Try it online!](https://tio.run/nexus/python2#S7ON@Z@TmJuUkqhQbKWuoK5lol2sV5RakJOYnKqhHpOnrgMkFIBAXfN/SWpxiYKturq6c35KKpdvflGqQjKQBRTgKijKzCvRSNMAKdHU/A8A)**
[Answer]
# JavaScript, 26 bytes
Thanks @Conor O'Brien for golfing off 8 bytes
```
x=>x.replace(/^/gm,"    ")
```
Replace with a regex with /g replaces all instances. m makes the regex treat each line separately for the start of the string ^.
[Try it online!](https://tio.run/nexus/javascript-node#S7P9X2FrV6FXlFqQk5icqqEfp5@eq6OkAARKmv@T8/OK83NS9XLy0zXSNJTS8vNj8pISi2LyEotT0pQ0Nf8DAA "JavaScript (Node.js) – TIO Nexus")
[Answer]
# Python 2, ~~87~~ 45 bytes
```
print' '*4+'\n    '.join(input().split('\n'))
```
Input is taken as `'Line1\nLine2\nLine3...'` (Quotes necessary)
Thanks to @WheatWizard for giving me an idea that helped me golf 42 bytes. 
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 8 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
Ỵṭ€⁶ẋ4¤Y
```
**[Try it online!](https://tio.run/nexus/jelly#@/9w95aHO9c@alrzqHHbw13dJoeWRP7//19dXd05PyWVyze/KFUhGcgCCgAA "Jelly – TIO Nexus")**
### How?
```
Ỵṭ€⁶ẋ4¤Y - Main link: string
Ỵ        - split on newlines
      ¤  - nilad followed by ink(s) as a nilad:
   ⁶     -     a space character
    ẋ4   -     repeated four times
 ṭ€      - tack for €ach
       Y - join with newlines
```
Some other 8 byte variants are:  
`Ỵṭ€⁶Yµ4¡` (4 repeats of split on newlines, tack a single space);  
[Answer]
# Emacs, 5 keychords, 5 bytes
```
C-x h M-4 C-x tab
```
In at least one commonly used encoding for keyboard entry, each of these keychords is a single byte: `18 68 b4 18 09`. Emacs entries tend to be very keychord-heavy, as each printable ASCII character stands for itself except as a subsequent character of a multi-character command (meaning that only keychords can be used to give actual commands).
I'm not sure how this compares to Vim (as opposed to V). But Vim is fairly commonly used on PPCG, and so I thought the other side of the editor wars deserves its time in the spotlight too.
This assumes that I/O is done via the buffer (the equivalent of the normal I/O conventions for vim), or taken from a file and output onto the screen (which comes to the same thing). If you do I/O via the region instead, which is natural for some forms of program, you can remove the leading two characters, for a score of 3 bytes; however, I don't think that complies with PPCG rules.
## Explanation
```
C-x h M-4 C-x tab
C-x h               Specify the entire buffer as the region
      M-4           Give the argument 4 to the next command that runs
          C-x tab   Increase the indentation level of each line by a constant
```
The last builtin used here is, of course, incredibly useful for this challenge; the rest is just structure.
[Answer]
# PowerShell, ~~29~~ 28 Bytes
```
"$args"-split"
"|%{" "*4+$_}
```
-1 Thanks to fergusq, using an actual newline instead of the `n
takes the `"$args"` input as a string (cast using "s) and `-split`s it on a newline, then loops (`%{}`) through it, appending four spaces (`" "*4`) and the line (`$_`) then outputs it implicitly.
[Answer]
# Pyth, 10 Bytes
```
jm+*4\ d.z
```
[Try it!](https://pyth.herokuapp.com/?code=jm%2B%2a4%5C+d.z&input=a%0Ab%0Ac&debug=0)
If input as a list of lines would be allowed, I could do it in 7 bytes:
```
jm+*4\ 
```
[Try that](https://pyth.herokuapp.com/?code=jm%2B%2a4%5C+d.z&input=a%0Ab%0Ac&debug=0)
### longer solutions:
12 Bytes:
```
+*4d:Eb+b*4d
```
12 Bytes:
```
+*4dj+b*4d.z
```
13 Bytes:
```
t:E"^|
"+b*4d
```
[Answer]
# [Röda](https://github.com/fergusq/roda), 21 bytes
```
{(_/"
")|[`    $_
`]}
```
[Try it online!](https://tio.run/nexus/roda#y03MzKvm4szMKygtUbCyVYjOTEnNK8ksqdTQjFVTislT4uIsKC3O0AAr0FSo@V@tEa@vxKWkWROdoAAEKvFcCbG1/2v/O@enpHL55helKiQDWQA "Röda – TIO Nexus")
It is an anonymous function. The input is pulled from the stream.
Explanation:
```
{
    (_/"\n") |        /* Splits the input at newlines */
    ["    ".._.."\n"] /* For each line, prints four spaces before the line */
}
```
[Answer]
# [Perl 5](https://www.perl.org/), 11+1 = 12 bytes
11 bytes of code + `-p` flag.
```
s/^/    /mg
```
[Try it online!](https://tio.run/nexus/perl5#U1YsSC3KUdAtMPhfrB@nrwAE@rnp//8756ekcvnmF6UqJANZAA "Perl 5 – TIO Nexus")
For once, explanations will be short: The regex replaces each beginning of line (`^` combined with `/m` modifier) by four spaces - the end. 
[Answer]
# [Perl 6](https://perl6.org), 11 bytes
```
*.indent(4)
```
[Try it](https://tio.run/nexus/perl6#Ky1OVSgz00u25sqtVFBLzk9J1c3MS0nNK0ktUrD9r6UH4WiYaP635iooyswrUUBRo1GcU1pUoPnfGSjI5ZtflAqWBgA "Perl 6 – TIO Nexus")
## Expanded:
```
*\       # declare a WhateverCode lambda/closure (this is the parameter)
.indent( # call the `indent` method on the argument
  4      # with the number 4
)
```
[Answer]
# [sed](https://www.gnu.org/software/sed/), 16 10 9 bytes
```
s/^/    /
```
[Try it online!](https://tio.run/nexus/sed#RY7LCsIwEEXXyVdcYqAKSrFr8yWiUpqpGeyLNNCF@u11WhFnMwz3cWYe82sOmXyep8ANIVLpcYhouCPte602uFMCe9Sxb1GLp9BqXTf2zm6pCj3sYscL5fRA9hwidwn2@M52S55riY9oy1SFPb7iWq9EOcNYTtRKmYFzcv26DS5apUCdVuoPWdjyl9BO4i3MBw "sed – TIO Nexus")
**Edits**
Reduced solution size from 16 to 10 bytes thanks to **Kritixi Lithos**.
-1 byte thanks to **seshoumara**.
[Answer]
# Java 7, 58 bytes
```
String c(String s){return"    "+s.replace("\n","\n    ");}
```
**Explanation:**
[Try it here.](https://tio.run/nexus/java-openjdk#lY8xCsMwDEX3nEJ4smnJBTJ2zpSx7uA6pjU4crCVQgk@e6oUjxlaIYTQ/zz0bTA5Q782AJkMeQvbQMnjA6ysi1FrcrQkFMAlTqZNbg7GOik0ijOP7111ZQOYl3tgSGW9oh9hMh4r63rbac3uH96Z3NTGhdqZJZJWikscncY@JgeWV6FUd@gNKP9Wdr6tYTX@8qbGA7oWQ5wcPdmlObLGwl0fLU3ZPg)
* Append with four leading spaces
* Replace every new-line for a new-line + four spaces
[Answer]
# [Brain-Flak](https://github.com/DJMcMayhem/Brain-Flak), ~~109~~ 103 bytes
-6 thanks to [Wheat Wizard](https://codegolf.stackexchange.com/users/56656/wheat-wizard)
Includes +1 for `-c`
```
((()()()()()){}){(({}<>)[()()((()()()()){})]<(((((({}){}){}))))>){(<{}{}{}{}{}>)}{}<>}<>{({}<>)<>}<>{}
```
[Try it online!](https://tio.run/nexus/brain-flak#@6@hoaEJg5rVtZrVGhrVtTZ2mjYaUIAsB0ZAYBeNqisWqM2muhYG7TRrQWYAUTXUMDC79v9/5/yUVC7f/KJUhWQQS0EBJKBQXJJYVJKZl65QnlmSoVBckJicWvxfNxkA "Brain-Flak – TIO Nexus")
```
((()()()()()){})        # Add a newline to the beginning
                        # This is needed to get spaces infront of the first line)
{                       # For every character (call it C)
  (({}<>)               #   Move C to the other stack
  [()()((()()()()){})]  #   Push 8 and subtract 10 (\n) from C
  <(((((({}){}){}))))>) #   Push 4 spaces using the 8 from earlier
  )                     #   Push C - 10
  {(<                   #   If C - 10 != 0...
    {}{}{}{}{}          #     Pop the 4 spaces that we added
  >)}{}                 #   End if
  <>                    #   Switch stacks to get the next character
}                       # End while
<>{({}<>)<>}<>          # Reverse the stack (back to the original order)
{}                      # Pop the newline that we added
```
[Answer]
# [J-uby](http://github.com/cyoce/J-uby), ~~17~~ 16 Bytes
```
~:gsub&' '*4&/^/
```
### Explanation
```
~:gsub           # :gsub with reversed arguments: 
                 # (f)[regex,sub,str] == str.gsub(regex, sub)
      &' '*4     # replace with four spaces
            &/^/ # match the start of each line
```
This directly translates to (in Ruby):
```
->s{s.gsub(/^/,' '*4)}
```
[Answer]
# PHP, 43 Bytes
```
<?="    ".strtr($_GET[0],["\n"=>"\n    "]);
```
[Answer]
# [Stacked](https://github.com/ConorOBrien-Foxx/stacked), 13 bytes
```
'^'4' '*mrepl
```
[Try it online!](https://tio.run/nexus/stacked#VZBBSwMxEIXv@ytiLtkU2ZO3PS2FIigI3YIIRUh3pzUwm6zJRFukv32NabTru@Tx@MibGaGH0Tpia3gP4MlXi7rIUXvyBMMsWAXTkbZmDjU7H1yvSUNKx7BD3bEOlffsHhDts3XYP2oDzThuYgP7KhhjmfOkKD4qfcIGpQ0r5YWIygO4y2jLWGwRWnAfuoNSVtaUGYz6mz@bVcC9RoQ@I7Lq7Qy/rrLPbuXssDmN0JLT5jBDf8SPVacQyy1PO92ytNXNlsuaX0lZfWp6K/mRy9/WOhsHFJz5d611ipa2j5WKgn96aF4Sfi7OYhKv4k4wsRgcjDjZQNM3 "Stacked – TIO Nexus")
## Explanation
```
'^'4' '*mrepl      (* input: top of stack *)
        mrepl      perform multiline regex replacements,
'^'                  replacing /^/ with
   4' '*             four spaces
```
[Answer]
# Octave, 17 bytes
```
@(s)["    "';s']'
```
[Try it online!](https://tio.run/nexus/octave#@@@gUawZraQABErq1sXqser/02wT84qtuYpto/X09LjUPTLVudQVKvNLi0C0Ql5ibiqIkVkMJNPz89NzUtVjrbnSgMb8BwA "Octave – TIO Nexus")
[Answer]
# PHP, 16
```
echo"    $argn";
```
run with `php -R <code>`. `-R` runs the given code for every input line and `$argn` is fed the current input line. So this simply prints each line with additional four spaces in front of it.
[Answer]
# [V](https://github.com/DJMcMayhem/V), 3 bytes (Non-competing)
```
4>G
```
This is answer uses a feature that I have been planning on adding for a while, but just got around to adding today. That makes this answer non-competing and invalid for winning. But it's still cool to show off such a useful/competitive feature! 
[Try it online!](https://tio.run/nexus/v#DcexDYAwDATAPlP8ENRpWYAFkGLgpeBEsZnfuLuLre4Rx0MDrQCngtpEXVoOeL/u7FTJmS/qXa6x4GKexhxcc5jYDw "V – TIO Nexus")
Explanation:
```
4>   " Add an indent of 4 to...
  G  "   Every line from the current line (0 by default) to the end of the buffer
```
[Answer]
# Vim, 6 keystrokes
```
<Ctrl-V>G4I <Esc>
```
Assumes that the cursor is on the beginning of the file, as if you opened the file from from the command line via `vim filename`.
```
<Ctrl-V>            " Enter visual block move (enables rectangular selection)
        G           " Move to bottom line (selecting the entire first column)
         4          " Repeat the following action 4 times
          I         " Insert at start of (each selected) line
                    " [input a space]
            <Esc>   " Exit insert mode
```
With a vim configured to use 4 spaces for indentation it would be 2 keystrokes: `>G`.
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 7 6 bytes
*Saved 1 byte thanks to @ETHproductions*
```
miS²²R
```
[Try it online!](https://tio.run/nexus/japt#@5@bGXxo06FNQf//KyVyKSgkcSVzKaQoKACZCgqpSly6QQA)
### Explanation:
```
miS²²R
m       // At each char in the input:
 iS²²   //   Prepend " " repeated 4 times
     R  // Rejoin with newlines  
```
[Answer]
# [UberGenes](https://esolangs.org/wiki/UberGenes), 62 bytes
I had to enter this challenge with UberGenes, as a very similar program (that only inserted one space) was one of the first programs I ever wrote in the language, and it seemed like it would be easy to modify for this purpose.
```
=aA=p9=z4=cI=AC+a1-z1:pz=Ao:CA:Ii  =b5+b5-bA+a1=d3*d7:db=i0   
```
How it works:
```
=aA                                                         Set a to 61
                                                            (Begin main loop)
   =p9                                                      Set p to 9
      =z4                                                   z counts spaces
         =cI                                                Set c to 61
                                                            (Jumping to p jumps here)
            =AC                                             Put the space at position 61
                                                              at position a.
               +a1-z1                                       Move a right and decrement z
                     :pz                                    Jump to p if z is nonzero
                                                            (Jumping to d jumps here)
                        =Ao                                 Read a character to position a.
                           :CA                              Jump to position 32+3 if input
                                                              was nonzero.
                              :Ii                           Otherwise, jump to position 61,
                                                              causing the entire string
                                                              that begins there to be
                                                              printed before halting.
                                                            (This is position 32+3=35)
                                   =b5+b5                   Set b to 10 (newline).
                                         -bA                Subtract the input character to
                                                              compare it with newline.
                                            +a1             Move a right.
                                               =d3*d7       Set d to 21
                                                     :db    Jump to d if not newline.
                                                        =i0 Jump back to begin main loop.
(The 3 spaces at the end position a space character at position 61 so that, after =cI,
C refers to the space character--it will also be the first space printed.)
```
[Answer]
# [CJam](https://sourceforge.net/p/cjam), 11 bytes
*Thanks to [@Challenger5](https://codegolf.stackexchange.com/users/61384/challenger5) for a correction*
```
qN/{S4*\N}%
```
[**Try it online!**](https://tio.run/nexus/cjam#@1/op18dbKIV41er@v@/c35KKpeCgmdeSmpeSWqKQjKI75tflApmAQA "CJam – TIO Nexus")
### Explanation
```
q              e#  Read whole input as a string with newlines
 N/            e#  Split at newlines, keeping empty pieces. Gives an array of strings
   {     }%    e#  Map this function over the array of strings
               e#  The current string is automatically pushed
    S4*        e#  Push a string of four spaces
       \       e#  Swap. Moves the original string after the four spaces
        N      e#  Push a newline
               e#  Implicity display stack contents
```
[Answer]
# [Actually](https://github.com/Mego/Seriously), 16 bytes
```
9uc;§s⌠' 4*+⌡M@j
```
[Try it online!](https://tio.run/nexus/actually#@29Zmmx9aHnxo54F6gomWtqPehb6OmT9/5@Wn8@VlFgExFUA "Actually – TIO Nexus")
Explanation:
```
9uc;§s⌠' 4*+⌡M@j
9uc;              push two newlines
    §s            raw input, split on newlines
      ⌠' 4*+⌡M    for each line:
       ' 4*+        prepend 4 spaces
              @j  join with newlines
```
[Answer]
# C, ~~66~~ 65 bytes
```
p(){printf("    ");}f(char*s){for(p();*s;)putchar(*s++)-10||p();}
```
[Try it online!](https://tio.run/nexus/c-gcc#@1@goVldUJSZV5KmoaQABEqa1rVpGskZiUVaxZrVaflFGkAV1lrF1poFpSUgYQ2tYm1tTV1Dg5oakEztf6BehdzEzDwNTa5qLpARQJOc81NSY/J884tSFZJhzGIIG2gBV@1/AA)
[Answer]
# Ruby, ~~22~~ 21 Bytes
1 Byte saved thanks to [@manatwork](https://codegolf.stackexchange.com/users/4198/manatwork)
```
->s{s.gsub /^/,' '*4}
```
Takes `s`, replaces all occurences of `/^/` (start of line) with four spaces.
]