I dislike the fact that in order insert a code block I have to smash my space bar 4 times for each line.
Edit your code block over at the left margin as you would normally edit any code. Then do a block insert of 4 spaces down the left side of your code block. That's how I do it.
line of code
line of code
indented line of code
line of code
In vim, after editing your code like you usually would: Go to the front of the top line,
Ctrl-V to enter visual block mode (Ctrl-Q on windows),
jjj to the bottom line,
I (capital I) to insert at the front,
space space space space,
escape.
I did exactly that to create the above two blocks. Capital V
jjjjj
>
Or 6>>~~~
// your code // goes here // and here
~~~
```python
from functools import partial
def foo(a,b,i):
if i >= a and i <= b:
return i**2
else:
return 0
print reduce(lambda x,y: x+y,map(partial(foo,3,7),xrange(1,10)))
```