Real Vim ninjas count every keystroke - do you?

Pick a challenge, fire up Vim, and show us what you got.

Changelog, Rules & FAQ, updates: @vimgolf, RSS.

Your VimGolf key: please sign in

$ gem install vimgolf
$ vimgolf setup
$ vimgolf put 5518cd2bfb03aa1d9402a6a3

Fix the XML

The challenge consists in having a valid xml from an incomplete source.

Start file
<I>
    <hate>
        <xml>hello
        <files>files
    </hate>
    <hate>
        <xml>xml
        <files>world
    </hate>
</I>
End file
<I>
    <hate>
        <xml>hello</xml>
        <files>files</files>
    </hate>
    <hate>
        <xml>xml</xml>
        <files>world</files>
    </hate>
</I>

View Diff

3,4c3,4
<         <xml>hello
<         <files>files
---
>         <xml>hello</xml>
>         <files>files</files>
7,8c7,8
<         <xml>xml
<         <files>world
---
>         <xml>xml</xml>
>         <files>world</files>

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 278 remaining solutions by signing in and submitting your own entry
#279 Rafal C. / @RafalC37709324 - Score: 125 - 11/17/20 @ 20:16
jjev%%f>y$<Esc>hhhhhhhhhvlllly$Pupj^ehhhhhvely$p<Esc>hhhhhi/<Esc>khhi/<Esc>jjjjahhh<BS><BS><BS>hh<BS><BS><Esc>hhhhhhhvllllly$ap<Esc>p<Esc>hhhhhhxli/<Esc>$x<Esc>ja</files><Esc>h:wq<CR>

0 comments


Created by: @leo_luz

279 active golfers, 958 entries

Leaderboard (lowest score wins):
46
#271 - Jon Featherstone / @feathj

06/21/2015 at 05:07AM

47
#272 - Ayman Farhat / @aymanfarhat

06/03/2015 at 12:07PM

48
#273 - Samir Sadek / @netsamir

07/20/2015 at 02:29PM

49
#274 - rappenstein2 / @rappenstein2

01/17/2022 at 04:29PM

51
#275 - Luis Rodriguez / @luisthecoder

11/16/2018 at 03:38AM

57
#276 - Anthony Astige / @AnthonyAstige

04/01/2015 at 12:34AM

62
#277 - Theodore DeRego / @tedsta0

12/08/2015 at 03:13AM

75
#278 - Jiawei Li / @calvin_lee2

01/24/2022 at 05:23AM

125
#279 - Rafal C. / @RafalC37709324

11/17/2020 at 08:16PM