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 798 remaining solutions by signing in and submitting your own entry
#799 梁(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

799 active golfers, 3341 entries

Leaderboard (lowest score wins):
19
#601 - David W / @DavidWi14576388

03/07/2020 at 08:56PM

19
#602 - ひらの / @uunikura

03/09/2020 at 03:50AM

19
#603 - Dongwook Lee / @nephilimz

03/13/2020 at 01:53AM

19
#604 - xer0.5ive / @Bibekshah

03/13/2020 at 02:37AM

19
#605 - Gabriel Niko Mojica / @MojicaNiko

03/13/2020 at 06:05AM

19
#606 - Omer Hamerman / @omergsr

03/22/2020 at 09:33PM

19
#607 - Adi Eyal / @SoapSudTycoon

03/28/2020 at 08:25AM

19
#608 - ntaλbs / @ntalbs

04/01/2020 at 10:08AM

19
#609 - Digvijay Patankar / @dbpatankar

04/02/2020 at 05:09PM

19
#610 - Alex Norman / @Aarleks

04/05/2020 at 02:00PM

19
#611 - yuanchuan / @yuanchuan23

04/14/2020 at 02:58AM

19
#612 - Shalin Scupham / @shalin_scupham

04/21/2020 at 02:25AM

19
#613 - kanye west's vas deferens / @gayshot27

05/11/2020 at 05:23AM

19
#614 - Bonamanada / @Bonamanada

05/11/2020 at 08:25AM

19
#615 - social distancing before it was cool / @wrmrx

05/11/2020 at 08:43PM

19
#616 - Sebastian / @dersharky

05/13/2020 at 02:29PM

19
#617 - Parthasarathi Khirwadkar / @ParthKhirwadkar

05/13/2020 at 03:50PM

19
#618 - chan hong iq / @IqHong

05/25/2020 at 04:24AM

19
#619 - Brent / @PRFNTX

05/27/2020 at 03:14PM

19
#620 - Harry Doran / @harrydorandev

06/02/2020 at 03:11PM

19
#621 - pheeria / @pheeria

06/15/2020 at 08:58PM

19
#622 - Jacob Shomstein / @jshoms

06/16/2020 at 03:18AM

19
#623 - 鏡崎ましろ / @KagamisakiMsr

06/16/2020 at 07:35AM

19
#624 - infinitesimal being 🎮 / @hydr063n

06/20/2020 at 08:57PM

19
#625 - hisham maged / @hisham_maged

06/27/2020 at 12:20PM

19
#626 - Mikail Khan / @PM_ME_CAT_GIFS

07/02/2020 at 01:41PM

19
#627 - L Z / @unidevel

07/05/2020 at 12:59AM

20
#628 - phe / @phelipetls

02/27/2020 at 02:45AM

20
#629 - Laurent Atlan / @laurentatlan1

03/03/2020 at 07:46PM

20
#630 - Тёма / @Timon_Surikat

03/04/2020 at 01:11PM