Real Vim ninjas count every keystroke - do you?

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

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

Your VimGolf key: please sign in

$ gem install vimgolf
$ vimgolf setup
$ vimgolf put 4f081a4ef037090001000074

constructor

coding a constructor for a simple class

Start file
class SongEntry
{
public:
    SongEntry
        (
        QString mSinger = QString(),
        QString mSongName = QString(),
        QString mGender = QString(),
        QString mSongLang = QString(),
        int mSongLength = 0,
        QString mSongPath = QString(),
        QString mNotes = QString()
        );

private:
    int mId;
    QString mSinger;
    QString mSongName;
    QString mGender;
    QString mSongLang;
    int mSongLength; // in seconds
    QString mSongPath;
    QString mNotes;
};

===========================================================
End file
class SongEntry
{
public:
    SongEntry
        (
        QString mSinger = QString(),
        QString mSongName = QString(),
        QString mGender = QString(),
        QString mSongLang = QString(),
        int mSongLength = 0,
        QString mSongPath = QString(),
        QString mNotes = QString()
        );

private:
    int mId;
    QString mSinger;
    QString mSongName;
    QString mGender;
    QString mSongLang;
    int mSongLength; // in seconds
    QString mSongPath;
    QString mNotes;
};

===========================================================

SongEntry::SongEntry
    (
    QString aSinger,
    QString aSongName,
    QString aGender,
    QString aSongLang,
    int aSongLength,
    QString aSongPath,
    QString aNotes
    )
    : mSinger( aSinger )
    , mSongName( aSongName )
    , mGender( aGender )
    , mSongLang( aSongLang )
    , mSongLength( aSongLength )
    , mSongPath( aSongPath )
    , mNotes( aNotes )
{
}

View Diff

26a27,46
> 
> SongEntry::SongEntry
>     (
>     QString aSinger,
>     QString aSongName,
>     QString aGender,
>     QString aSongLang,
>     int aSongLength,
>     QString aSongPath,
>     QString aNotes
>     )
>     : mSinger( aSinger )
>     , mSongName( aSongName )
>     , mGender( aGender )
>     , mSongLang( aSongLang )
>     , mSongLength( aSongLength )
>     , mSongPath( aSongPath )
>     , mNotes( aNotes )
> {
> }

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 40 remaining solutions by signing in and submitting your own entry
#41 Dan Huang / @yuzeh - Score: 127 - 02/15/12 @ 23:21
3jy10yGo<Esc>p0V<Esc><Esc><C-V>3l10jxjjqq2wrawhd$a,<Esc>0jq3kyw$a::<Esc>pjjj06@q$xo<BS><BS><BS><BS>{<CR>}<Esc>30Gy7y7jpkk$xjj0qwwdwi, <Esc>lg<Esc><Esc>hyePbrmea(<Esc>$i )<Esc>$xj0q6@w7kwr:ZZ

0 comments

#42 Ben Friedland / @bfriedland174 - Score: 139 - 05/20/12 @ 22:47
wywGo<CR><Esc>pa::<Esc>p17GV6jyG2p4jf;d$a;<Esc>4k)29GO(<Esc>jqqwrawr,<Esc>j0wq5@q2Qvisual<CR>2<Esc>2<Esc>@qkf,d$o)<Esc>jqqcw,<Esc>wywwR( <Esc>p<Esc>braA )<Esc>j0wq6@qkkwi )<Esc>ld$38Gr:Go<Esc>r{i{<CR>}<Esc>ZZ

0 comments

#43 not so punk :] / @notsopunk - Score: 143 - 03/30/12 @ 21:36
wywGo<CR>::<Esc>p0Po{<CR>}<Esc>?Si<CR>y6jGPu-PO(<Esc>qq+wrawr,C,<Esc>+q@@@q@q@q:30<CR>@@@@@@A<BS><Esc>o)<Esc>V{++<Esc>jyi(G-PGkdwqq-cw,<Esc>wywrmA()<BS>  )<Esc>hPq@q@@4@@F(hxjwxjbxjwxjwxjbx:38<CR>r:ZZ

0 comments

#44 neerajsharma / @neerajsharma - Score: 144 - 01/25/12 @ 02:04
3jw<C-V>9j$yGo<NL><Esc>pjj::,+7s/\(.*\) m\(\w*\)[^,]*\(,*\)/\1 a\2\3/g<Home><Del><NL>yi(Gpi<NL><Esc>::,+7s/\(\S*\) a\([^,]*\),*/, m\2( a\2 )/g<NL>6kr:Gddo{<NL>}<Esc><<<Esc>k<<<Esc>28GywPa::<Esc>ZZ

0 comments

#45 Thijs Brobbel / @tiesmaster - Score: 171 - 02/03/12 @ 07:22
}3jV6jyGpO<CR>so<C-N>::so<C-N><CR>(<Esc>k<<jjVG:s/ m/ a<CR>gv:s/;.*/,<CR>gvyGpkA<BS><CR>)<Esc>jVG:s/,/ )<CR>o{<CR>}<Esc>Vk<k*Ncw, mn<C-N>(<Esc>Ncw, mso<C-N><C-P><C-P>(<Esc>k0wcw, l<BS>mso<C-N><C-P><C-P>(<Esc>Ncw, mso<C-N><C-P><C-P>(<Esc>Ncw, mg<C-N>(<Esc>Ncw, mso<C-N><C-P><C-P>(<Esc>Ncw: ms<C-N><C-P><C-P>(<Esc>ZZ

0 comments

#46 J. / @jdot - Score: 175 - 02/15/12 @ 11:49
jjjma/;<CR>y'aGo<Esc>pGpddddqddwjq@d@d@d@d@d@d0C{<CR>}<Esc>kkqd0fmmaf y`af plDa )<Esc>I, <Esc>f i(<Esc>llrakq@d@d@d@d@d@djF,r:klxkqd0fmraf Da,<Esc>kq@d@d@d@d@d@dkYPJxi;;<BS><BS>::<Esc>0<C-V>llljjjjjjjjjjjjjjjjx/aN<CR>$x:x<CR>

0 comments

#47 Forrest L Norvell / @othiym23 - Score: 202 - 01/27/12 @ 03:00
3jV9jyGo<Esc>p:set sw=4<CR>VG<y$A::<Esc>pjj^:s/ m\([^ ]\+\) =.*$/ a\1,/<CR>j:s<CR>j:s<CR>j:s<CR>j:s<CR>j:s<CR>j:s<CR>$x%jxkV6kyGp:s/[^ ]\+ a\([^ ]\+\)_<BS>,/: m\1( a\1 )<CR>j:s<Up><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><BS>,<CR>j:s<CR>j:s<CR>j:s<CR>j:s<CR>j:<Up><Up><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><BS>$<CR>0o<Esc>0i{<CR>}<Esc>:wq<CR>

0 comments

#48 Luke Zulauf / @azound - Score: 209 - 01/31/12 @ 11:49
wywGop<BS><Esc>p<Esc>ko<Esc>j$a::<Esc>po    (<CR><Esc>:set rela<Tab><CR>25<BS>424<Esc>22ky6jGpPV6j:s/\<m\(\w*\).*$/a\1,<CR>$xo<BS>    )<Esc>8kddi<BS><BS><BS><BS><Esc>j.uldwj.j.j.j.j.jjVG:s/.<BS>%<BS>.* m\(\w*\).*$<Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left>^<End>/    m\1( a\1 )<Left><Left><Left><Left><Left><Left><Left><Left><Left><Left>, <CR>6kr:Go<BS><BS><BS><BS>{<CR>}<Esc>:q<CR>:wq!!<BS><CR>

0 comments

#49 Markus / @markus1189 - Score: 210 - 04/19/12 @ 06:17
w"syw15jjV6j"myGo<CR><Esc>"spa::<Esc>"spo    (<CR><Esc>"mpkddjkVjjjjjjj:s/\v\sm/ a<CR>kkkkkkqqf;C,<Esc>jq@q@@@@^@@^@@^@@^@@r xVkkkkkk"ayGo)<CR><Esc>"mpkdddwj.j.j.j.j.j.kkkjjj<C-V>kkkkkkI, <Esc>r:eqq^wlywea( a<C-R>" )<Del><Esc>jq@q@@@@@@@@@@kkf/hDGo<BS><BS><BS><BS>{}<Esc>i<CR><Esc>:wq<CR>

0 comments

#50 Philippe Mongeau / @phmongeau - Score: 221 - 01/18/12 @ 18:58
3jV/;<CR>yGp:set w<BS>sw=4<CR>VG<ywA::<C-R>"<Esc>jjvi(:%s/ ,<BS>m/ a/g<CR>kjvi(:s/ m/ a/g<CR>{jjjjqq0t=C,<Esc>jq6@qh%Vi(k$yk%lpdtQi<BS><CR>: <Esc>hxx<C-V>Gkwehhhx<C-V>4jkllxu<C-V>jjjelx4jj<C-V>jwhx6kji: <Esc>lywA<BS>( <C-R>" )<Esc>jqq0wywA<BS>( <C-R>" )<Esc>2Bi, <Esc>jq5@q6kkl<C-V>6jrmGi{<CR>}<Esc>?s,<CR>lx?songE<BS>e<CR>O<Esc>ZZ

0 comments

#51 無ん垢の叫び / @john_ababa - Score: 392 - 02/29/12 @ 00:21
Go<Esc>:a!<CR>SongEntry::SongEntry<CR>    (<CR>    QString aSinger,<CR>    QString aSongName,<CR>    QString aGender,<CR>    QString aSongLang,<CR>    int aSongLength,<CR>    QString aSongPath,<CR>    QString aNotes<CR>    )<CR>    : mSinger( aSinger )<CR>    , mSongName( aSongName )<CR>    , mGender( aGender )<CR>    , mSongLang( aSongLang )<CR>    , mSongLength( aSongLength )<CR>    , mSongPath( aSongPath )<CR>    , mNotes( aNotes )<CR>{<CR>}<CR><Esc><Esc>ZZ

0 comments

Created by: @Arton0306

51 active golfers, 149 entries

Leaderboard (lowest score wins):
Q6hrg93p4r3hn56thmd0_normal
59
#1 - Urtica dioica / @udioica

07/01/2012 at 04:24PM

40051_789281885907_29616532_44170636_2091417_n_normal
59
#2 - Conner McDaniel / @connermcd

09/17/2012 at 10:25PM

Default_profile_1_normal
61
#3 - John Anderson / @opejn

03/18/2012 at 12:51AM

T_e_normal
61
#4 - Tim Chase / @gumnos

05/04/2012 at 11:24AM

Default_profile_2_normal
62
#5 - Renat Aksitov / @Korvin79

02/29/2012 at 02:19AM

Dmau-crop4_normal
64
#6 - veki / @vx_ras

02/02/2012 at 03:22PM

Default_profile_6_normal
67
#7 - Henri Wiechers / @hwiechers

02/02/2012 at 09:00PM

Default_profile_2_normal
67
#8 - Tesnorth / @Tesnorth

02/05/2012 at 05:18AM

Abdel_normal
67
#9 - Abdel Said / @abdelsaid

02/10/2012 at 03:27PM

Bunnies_normal
69
#10 - Trevor Powell / @DoomedBunnies

01/26/2012 at 08:42PM

Jlove201003sq_normal
70
#11 - Justin Love / @wondible

01/11/2012 at 09:20AM

Oliver_normal
70
#12 - oliver mueller / @marcontwit

01/25/2012 at 12:15PM

Default_profile_3_normal
71
#13 - Sam Riesland / @str4mula

02/27/2012 at 12:12AM

152839_2037725121_normal
82
#14 - deris / @deris0126

04/05/2012 at 08:16AM

Mobile_photo_mar_15__2010_12_39_49_normal
82
#15 - Rod Knowlton / @codelahoma

05/06/2012 at 01:47PM

4654945923_eb2c60ee5f_normal
82
#16 - Kerson Hsiao / @KersonHsiao

07/04/2012 at 08:24AM

Default_profile_6_normal
87
#17 - William Dunand / @wdunand

01/12/2012 at 06:10PM

Photo_4_normal
88
#18 - maxthoursie / @maxthoursie

01/30/2012 at 09:13AM

Jbgutierrez_normal
88
#19 - Javier Blanco / @jbgutierrez

02/12/2012 at 06:26AM

Default_profile_4_normal
90
#20 - Pepe / @GomTvIneluki

04/16/2012 at 11:51AM

P1000007_normal
92
#21 - h_east (DDD ready) / @h_east

01/07/2012 at 03:25AM

Default_profile_4_normal
92
#22 - Grigoriy Glushko / @grinderrz

02/17/2012 at 10:30AM

Default_profile_1_normal
93
#23 - Tom Fetherston / @TomFetherston

01/22/2012 at 09:01PM

Victor_normal
95
#24 - Víctor Pimentel / @VictorPimentel

02/04/2012 at 07:31PM

Hxh-b_normal
97
#25 - Lin Yangyang / @canoelyy

01/31/2012 at 07:48AM

Default_profile_0_normal
98
#26 - Benoit Mortgat / @Benoit_Mortgat

06/06/2012 at 09:32AM

Default_profile_6_normal
99
#27 - Jomo / @yoyoyojomo

03/14/2012 at 12:50AM

Screen_shot_2012-04-05_at_2.58.30_pm_normal
100
#28 - Song Zheng / @songz

01/26/2012 at 04:19AM

Avatar_normal
100
#29 - Øystein Walle / @oysteinwalle

05/31/2012 at 12:33PM

Image1326661166_normal
101
#30 - Christopher Brew / @Seph1rothVII

01/23/2012 at 03:55PM

Fb_normal
107
#31 - Calvin Condon / @ccondon

01/29/2012 at 09:13PM

Photo1_normal
107
#32 - Mislav Marohnić / @mislav

03/19/2012 at 05:30AM

67d46cfa5ebf6b678b09b19c1d379e5c_normal
108
#33 - Radek / @qrczeno

04/19/2012 at 11:39AM

Default_profile_0_normal
108
#34 - Ilya Ermolin / @ermolinis

06/25/2012 at 09:04AM

Job_done_normal
114
#35 - pangloss / @tpattern

01/30/2012 at 11:11PM

Default_profile_2_normal
115
#36 - Maciej Suchecki / @mcSuchecki

01/07/2012 at 04:22AM

Default_profile_1_normal
124
#37 - Kurt Gaastra / @KGaastra

02/10/2012 at 02:21PM

Ich_neu_normal
125
#38 - Tibor Claassen / @codebeige

05/01/2012 at 02:31PM

Default_profile_3_normal
126
#39 - artanis / @artanislives

01/30/2012 at 09:07AM

Emblemofroto_normal
126
#40 - Glen / @Glen_S

07/21/2012 at 01:58PM

Image_normal
127
#41 - Dan Huang / @yuzeh

02/15/2012 at 11:21PM

Default_profile_3_normal
139
#42 - Ben Friedland / @bfriedland174

05/20/2012 at 10:47PM

122_normal
143
#43 - not so punk :] / @notsopunk

03/30/2012 at 09:36PM

Baby_ananya_317_normal
144
#44 - neerajsharma / @neerajsharma

01/25/2012 at 02:04AM

Default_profile_4_normal
171
#45 - Thijs Brobbel / @tiesmaster

02/03/2012 at 07:22AM

Profile_square_normal
175
#46 - J. / @jdot

02/15/2012 at 11:49AM

Pony2_normal
202
#47 - Forrest L Norvell / @othiym23

01/27/2012 at 03:00AM

Avatar-body-back_normal
209
#48 - Luke Zulauf / @azound

01/31/2012 at 11:49AM

Default_profile_2_normal
210
#49 - Markus / @markus1189

04/19/2012 at 06:17AM

Img_0417_crop_normal
221
#50 - Philippe Mongeau / @phmongeau

01/18/2012 at 06:58PM

Bc879469f279ee24b7fbdfad7c2216d9_normal
392
#51 - 無ん垢の叫び / @john_ababa

02/29/2012 at 12:21AM