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 5e4dfcccaa2db400090b66c3

prepend * to every non-blank line

Prepend an asterisk to every non-blank line in the input file.

Start file
This is a
very short

file, but it is 
still
full

of

surpises.
End file
*This is a
*very short

*file, but it is 
*still
*full

*of

*surpises.

View Diff

1,2c1,2
< This is a
< very short
---
> *This is a
> *very short
4,6c4,6
< file, but it is 
< still
< full
---
> *file, but it is 
> *still
> *full
8c8
< of
---
> *of
10c10
< surpises.
---
> *surpises.

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 1420 remaining solutions by signing in and submitting your own entry
#1421 梁(Liang リャン) / @starduliang - Score: 421 - 03/01/20 @ 11:54
:5s/^.+$/<Left><Left><Left><Left><Left><Left><Left><BS>%<Right><Right><Right><Right><Right><Right><Right><Right><Right><Right>i<BS>I*<CR><Up><CR><Esc><Esc><Esc><Esc><Esc>:%s/^<Left><Left><BS><BS>g<Right><Right><Right>.+$/I*<CR><Esc>/<BS>:g/^/*<CR>llllhhh<Esc>uuu<Esc>uujjjkkk/<Esc><Esc>/<BS>:g/^$<Esc><Esc><Esc>jj<Esc><Esc><Esc>:noh<CR>uu/<Esc><Esc>:s%/^/*<CR>:<Up>/<CR><CR>:<Up><Left><Left><Left><Left><Left><Left><BS><Right>%<BS>s<Right><Right><Right><Right><Right><Right><CR><Esc>u<Esc>u<Esc>u<Esc>u<Esc>u<Esc>:noh<CR>:g/^/*/<CR>:noh<CR>:<Up><Up><Left><Left><Left><Left><Left><Left><Left><Left><Right><Right><Right><Right><Right><Right><Right><Left><Left><Left><Left><Left><BS>g<CR>:noh<CR><Esc>:%s/^<Esc><Esc>jjjjjjjj:g/^\S<Left><Left>[<Right><Right><Right>]+$/*&/<CR>:<Up><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><BS>%s<Right><Right><Right><Right><CR>:<Up><Left><Left> <CR>:<Up><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><BS><BS><CR>:<Up><Left><Left><Left><Left><Left><Left><Left><Left><BS><Right><Right><Right><BS><Right><Right><CR>:<Up><Left><Left><Left><Left><Left>\<CR>:q<Esc><Esc><Esc>u:<Up><Up><Left><Esc><Esc><Esc>;<Esc>:noh<CR>:<Up><Up><Left>&<CR>u<Esc>:noh<CR>:<Up><Up><Left><Left><Left><Left><Left><Left><Left><Left><Left>.*<Right><Right>.*<Right><Right><Right><Right><Right><Right><Right><Right><CR>:<Up><Left><Left><Left><Left><Esc>b:<Up><Left><Left><Left><Left><Left><BS><BS><Left><Left><Left><Left><Left><Right><Right><Right><Right><CR>:wq<CR>

0 comments


Created by: @johnreitano

1421 active golfers, 5776 entries

Leaderboard (lowest score wins):
11
#601 - Epecb / @BceEpecb

09/22/2020 at 04:35PM

11
#602 - stanley förster / @stnlyfrstr

09/23/2020 at 07:33AM

11
#603 - Deepak Mittal / @dpacmittal

09/23/2020 at 08:08AM

11
#604 - BareTull / @BareTull3

09/23/2020 at 10:29AM

11
#605 - genoskill / @Genoskill

09/25/2020 at 06:41AM

11
#606 - z0k / @z0k

09/28/2020 at 03:52PM

11
#607 - Alexander Flick / @alexflick

09/28/2020 at 07:42PM

11
#608 - yaarrr / @v0lko

09/29/2020 at 10:21AM

11
#609 - BryanYan / @BryanGoesPlaces

09/29/2020 at 01:07PM

11
#610 - vasconssa / @vasconssa1

09/29/2020 at 09:57PM

11
#611 - mstronam / @mstronam

09/30/2020 at 12:28PM

11
#612 - teu cu / @j4derr

10/02/2020 at 05:55PM

11
#613 - Jambon Dunod / @JDunod

10/04/2020 at 03:09PM

11
#614 - Zigmas Bitinas / @ZigmasBitinas

10/05/2020 at 10:30PM

11
#615 - Brad Hubbard / @BradHubbard19

10/06/2020 at 01:06AM

11
#616 - Michael Forster / @MForsterMuc

10/06/2020 at 02:29PM

11
#617 - lamtt77 / @lamtt77

10/07/2020 at 05:50AM

11
#618 - Christian / @paierlep

10/07/2020 at 07:01PM

11
#619 - AAbraxas / @AAbraxas1

10/07/2020 at 08:08PM

11
#620 - jwatral / @JaroslawWatral

10/08/2020 at 09:15PM

11
#621 - Mark Korondi / @kmarc

10/09/2020 at 03:37PM

11
#622 - Eduardo / @earada

10/15/2020 at 07:10PM

11
#623 - Mike Harris / @MikeMJHarris

10/16/2020 at 03:56PM

11
#624 - SQ5RIX / @sq5rix

10/17/2020 at 10:54PM

11
#625 - Leo Winters / @LeoPWinters

10/19/2020 at 03:16PM

11
#626 - Henry MATHEISEN / @hmatheisen

10/20/2020 at 02:27PM

11
#627 - Free Man / @FreeMan16396552

10/21/2020 at 03:23AM

11
#628 - chocolate / @chocola81394123

10/23/2020 at 04:17AM

11
#629 - Jason Wang / @Jaded_Jason

10/23/2020 at 04:58AM

11
#630 - Em Dee / @VIMXPERT

10/23/2020 at 01:17PM