Indentation
Indent each line according to the right number of spaces it needs.
Start file
this line doesn’t have indentation
this line is indented with two spaces
this one has four
this other one has two
this one is indented with two spaces
this line has a four spaces indentation
this line needs six spaces
this line needs six spaces too
this line is back to four spaces
this line is finally indented with two spaces
this final line is not indented
End file
this line doesn’t have indentation
this line is indented with two spaces
this one has four
this other one has two
this one is indented with two spaces
this line has a four spaces indentation
this line needs six spaces
this line needs six spaces too
this line is back to four spaces
this line is finally indented with two spaces
this final line is not indented
View Diff
2,10c2,10
< this line is indented with two spaces
< this one has four
< this other one has two
< this one is indented with two spaces
< this line has a four spaces indentation
< this line needs six spaces
< this line needs six spaces too
< this line is back to four spaces
< this line is finally indented with two spaces
---
> this line is indented with two spaces
> this one has four
> this other one has two
> this one is indented with two spaces
> this line has a four spaces indentation
> this line needs six spaces
> this line needs six spaces too
> this line is back to four spaces
> this line is finally indented with two spaces
Solutions
The best way to learn is to practice. Below, you will find some of the solutions other golfers have entered. To unlock higher ranked solutions, submit your own entry which does as well or better than the solutions you can currently see - climb the ladder!
Check out these helpful resources to improve your Vim skills... Game on.
Unlock 179 remaining solutions by signing in and submitting your own entry
#180 Andy Brett / @andrewpbrett - Score: 170 - 12/30/10 @ 08:21
j <Left><Left>i <Down><Left><Left> <Down><Left><Left><Left><Left> <Down><Left><Left> <Down><Left><Left> <Down><Down><Up><Left><Left><Left><Left> <Down><Left><Left><Left><Left><Left><Left> <Down><Left><Left><Left><Left><Left><Left><Left> <Down><Left><Left><Left><Left> <Esc>:wq<CR>
0 comments