Append semicolon after expressions
Some lines need the semicolon, some don't.
Start file
var foo var bar = myCoolStuff() callRemote() foo = callTheWorld()
End file
var foo; var bar = myCoolStuff(); callRemote(); foo = callTheWorld();
View Diff
1c1 < var foo --- > var foo; 3c3 < var bar = myCoolStuff() --- > var bar = myCoolStuff(); 5c5 < callRemote() --- > callRemote(); 7c7 < foo = callTheWorld() --- > foo = callTheWorld();
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.
#135 Kevin McGladdery / @run_kmc - Score: 15 - 08/11/12 @ 16:58
A;<Esc>/)<CR>A;<Esc>n.n.ZZ
0 comments
#138 Viswanath Sivakumar / @viswanathgs - Score: 16 - 08/30/12 @ 08:24
:g/\S/s/$/;/g<CR>ZZ
0 comments
#139 lauri lehmijoki / @laurilehmijoki - Score: 17 - 06/02/12 @ 02:20
A;<Esc>:3<CR>.:5<CR>.:7<CR>.ZZ
@laurilehmijoki: This solution does not scale – regex substitutions are much better!
1 comment
#142 Christopher Biscardi / @chrisbiscardi - Score: 18 - 07/17/12 @ 00:29
A;<Esc>:%s/)/);/g<CR>:wq<CR>
0 comments
#143 Stephan Baumeister / @baumichel - Score: 19 - 07/12/12 @ 08:02
qq$a;<Esc>jjq@q@q@q:wq<CR>
0 comments
#145 Roel van Dijk / @rdvdijk - Score: 22 - 06/05/12 @ 08:50
:%s/\([o)]\)$/\1;/<CR><Esc>ZZ
0 comments
#146 Marco / @xmarkoz - Score: 22 - 06/28/12 @ 09:10
A;<Esc>2jA;<Esc>2jA;<Esc>2jA;<Esc>:wq<CR>
0 comments
#147 Calvin Flegal / @calflegal - Score: 25 - 06/20/12 @ 16:22
A;<Esc>yljj$pjj$pjj$p:qw<BS><BS>wq<CR>
0 comments
#148 Jacob Vosmaer / @jacobvosmaer - Score: 27 - 06/03/12 @ 04:32
:%norm <BS><BS><BS><BS><BS>s/$/;<CR>:%s/^;<CR>ZZ
0 comments
#149 Noel Alejandro / @noelrock333 - Score: 38 - 06/22/12 @ 17:08
:4<BS>%s.<BS>/s<BS>)/x<BS>no<BS><BS>/<BS>(<BS>);/<CR>1G7la;<Esc>:w<CR><C-W>q
0 comments
VimGolf