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 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 43 remaining solutions by signing in and submitting your own entry
#44 Dan Huang / yuzeh - Score: 127 - 02/16/12 @ 07: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

#45 Ben Friedland / bfriedland174 - Score: 139 - 05/21/12 @ 05: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

#46 not so punk :] / notsopunk - Score: 143 - 03/31/12 @ 04: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

#47 neerajsharma / neerajsharma - Score: 144 - 01/25/12 @ 10: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

#48 Thijs Brobbel / tiesmaster - Score: 171 - 02/03/12 @ 15: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

#49 J. / jdot - Score: 175 - 02/15/12 @ 19: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

#50 Forrest L Norvell / othiym23 - Score: 202 - 01/27/12 @ 11: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

#51 Luke Zulauf / azound - Score: 209 - 01/31/12 @ 19: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

#52 Markus / markus1189 - Score: 210 - 04/19/12 @ 13: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

#53 Philippe Mongeau / phmongeau - Score: 221 - 01/19/12 @ 02: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

#54 無ん垢の叫び / john_ababa - Score: 392 - 02/29/12 @ 08: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

54 active golfers, 161 entries

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

07/01/2012 at 11:24PM

59
#2 - Conner McDaniel / connermcd

09/18/2012 at 05:25AM

59
#3 - John Braxler / braxler

07/01/2014 at 06:27PM

61
#4 - John Anderson / opejn

03/18/2012 at 07:51AM

61
#5 - Tim Chase / gumnos

05/04/2012 at 06:24PM

62
#6 - Renat Aksitov / Korvin79

02/29/2012 at 10:19AM

64
#7 - veki / vx_ras

02/02/2012 at 11:22PM

67
#8 - Henri Wiechers / hwiechers

02/03/2012 at 05:00AM

67
#9 - Tesnorth / Tesnorth

02/05/2012 at 01:18PM

67
#10 - Abdel Said / abdelsaid

02/10/2012 at 11:27PM

69
#11 - Trevor Powell / DoomedBunnies

01/27/2012 at 04:42AM

70
#12 - Justin Love / wondible

01/11/2012 at 05:20PM

70
#13 - oliver mueller / marcontwit

01/25/2012 at 08:15PM

71
#14 - Sam Riesland / str4mula

02/27/2012 at 08:12AM

82
#15 - deris / deris0126

04/05/2012 at 03:16PM

82
#16 - Rod Knowlton / codelahoma

05/06/2012 at 08:47PM

82
#17 - Kerson Hsiao / KersonHsiao

07/04/2012 at 03:24PM

85
#18 - cj / cj01101

02/05/2014 at 10:51PM

87
#19 - William Dunand / wdunand

01/13/2012 at 02:10AM

88
#20 - maxthoursie / maxthoursie

01/30/2012 at 05:13PM

88
#21 - Javier Blanco / jbgutierrez

02/12/2012 at 02:26PM

88
#22 - Mauro Persano / fzort

05/24/2015 at 03:23PM

90
#23 - Pepe / GomTvIneluki

04/16/2012 at 06:51PM

92
#24 - h_east (トロッコ6個) / h_east

01/07/2012 at 11:25AM

92
#25 - Grigoriy Glushko / grinderrz

02/17/2012 at 06:30PM

93
#26 - Tom Fetherston / TomFetherston

01/23/2012 at 05:01AM

95
#27 - Víctor Pimentel / VictorPimentel

02/05/2012 at 03:31AM

97
#28 - Lin Yangyang / canoelyy

01/31/2012 at 03:48PM

98
#29 - Benoit Mortgat / Benoit_Mortgat

06/06/2012 at 04:32PM

99
#30 - Jomo / yoyoyojomo

03/14/2012 at 07:50AM

100
#31 - Song Zheng / songz

01/26/2012 at 12:19PM

100
#32 - Øystein Walle / oysteinwalle

05/31/2012 at 07:33PM

101
#33 - Christopher Brew / Seph1rothVII

01/23/2012 at 11:55PM

107
#34 - Calvin Condon / ccondon

01/30/2012 at 05:13AM

107
#35 - Mislav Marohnić / mislav

03/19/2012 at 12:30PM

108
#36 - Radek / qrczeno

04/19/2012 at 06:39PM

108
#37 - Ilya Ermolin / ermolinis

06/25/2012 at 04:04PM

114
#38 - pangloss / tpattern

01/31/2012 at 07:11AM

115
#39 - Maciej Suchecki / mcSuchecki

01/07/2012 at 12:22PM

124
#40 - Kurt Gaastra / KGaastra

02/10/2012 at 10:21PM

125
#41 - Tibor Claassen / codebeige

05/01/2012 at 09:31PM

126
#42 - artanis / artanislives

01/30/2012 at 05:07PM

126
#43 - Glen / Glen_S

07/21/2012 at 08:58PM

127
#44 - Dan Huang / yuzeh

02/16/2012 at 07:21AM

139
#45 - Ben Friedland / bfriedland174

05/21/2012 at 05:47AM

143
#46 - not so punk :] / notsopunk

03/31/2012 at 04:36AM

144
#47 - neerajsharma / neerajsharma

01/25/2012 at 10:04AM

171
#48 - Thijs Brobbel / tiesmaster

02/03/2012 at 03:22PM

175
#49 - J. / jdot

02/15/2012 at 07:49PM

202
#50 - Forrest L Norvell / othiym23

01/27/2012 at 11:00AM

209
#51 - Luke Zulauf / azound

01/31/2012 at 07:49PM

210
#52 - Markus / markus1189

04/19/2012 at 01:17PM

221
#53 - Philippe Mongeau / phmongeau

01/19/2012 at 02:58AM

392
#54 - 無ん垢の叫び / john_ababa

02/29/2012 at 08:21AM