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

899 active golfers, 3779 entries

Leaderboard (lowest score wins):
30
#871 - Max Well / @temp2004it

04/23/2020 at 07:19AM

30
#872 - Ved Verma / @dearved

06/01/2020 at 01:00AM

31
#873 - anass belcaid / @anassbelcaid1

05/02/2020 at 11:21AM

31
#874 - nick / @WhatsUpNickDown

05/11/2020 at 02:58AM

31
#875 - lingze / @_lingze

06/27/2020 at 04:18PM

31
#876 - binayak tiwari / @bintiw

08/03/2020 at 12:53AM

32
#877 - Kalbir / @proustian

04/27/2020 at 10:12PM

33
#878 - rolando / @ro1_ando

03/30/2020 at 09:50PM

33
#879 - Rudolf Scherman / @rudolf_scherman

06/12/2020 at 08:45AM

34
#880 - John Smith / @JohnSmi89587373

05/19/2020 at 08:36PM

34
#881 - brianhotopp / @brianhotopp

07/20/2020 at 11:31PM

35
#882 - steve bolo / @steve_bolo

02/26/2020 at 09:43PM

35
#883 - Marta / @AruizMarta

04/22/2020 at 04:01PM

35
#884 - Paul Rodgers / @oursjaune

05/08/2020 at 08:26PM

36
#885 - Corrado Franco / @corradofranco

03/01/2020 at 02:42PM

36
#886 - Petros Kapakos / @dapetros

05/08/2020 at 06:04PM

37
#887 - dotvimrc / @dotvimrc1

04/26/2020 at 04:16PM

37
#888 - Айбек Муратбеков / @mr_fourblack

05/15/2020 at 10:04AM

38
#889 - Jakub Iwanowski / @Jakub30399498

03/07/2020 at 11:53PM

41
#890 - 𝚕𝚘𝚛𝚍 / @padulkemid

03/11/2020 at 07:18PM

42
#891 - tengrui / @Rui_Teng

08/04/2020 at 12:04PM

45
#892 - giahuydo99 / @giahuydo99

05/28/2020 at 05:16AM

47
#893 - Sergio Soares / @sergsoares

04/21/2020 at 09:58PM

50
#894 - Pranshu Gaba / @PranshuGaba

04/13/2020 at 11:37AM

50
#895 - { allan serna } / @allaneserna

06/22/2020 at 03:43AM

57
#896 - mahmoux 🏳️‍🌈 🎗 / @3to1dash

06/26/2020 at 09:15AM

71
#897 - grug / @_grug

03/19/2020 at 06:04PM

113
#898 - migel1976 / @migel19760103

05/20/2020 at 08:18PM

421
#899 - 梁(Liang リャン) / @starduliang

03/01/2020 at 11:54AM