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

1065 active golfers, 4411 entries

Leaderboard (lowest score wins):
28
#1021 - Alex / @heliophobicdude

04/16/2020 at 09:17PM

28
#1022 - scott mysliwy / @scott_mysliwy

06/02/2020 at 07:22AM

28
#1023 - Vincent Alegrete / @valegrete

06/12/2020 at 12:18AM

28
#1024 - Анастасия / @BQQ4X7tQt1xvHKf

07/13/2020 at 04:19PM

28
#1025 - amadej.likes.pizza@gmail.com / @AmadejLikes

08/07/2020 at 04:05AM

28
#1026 - gchain / @gchain7

08/21/2020 at 03:02PM

28
#1027 - Albrecht Uhlig / @AlbrechtUhlig

08/27/2020 at 05:40AM

28
#1028 - elif bicer / @elifbicer1

09/17/2020 at 10:46PM

29
#1029 - Adam Haynes / @camomonkeyboy

05/08/2020 at 12:17AM

29
#1030 - Joseph Car / @JosephCar14

05/19/2020 at 11:39PM

29
#1031 - सागर पौडेल / @SagarP04d31

06/23/2020 at 02:19PM

29
#1032 - Ti / @TeeLaam

07/05/2020 at 05:24AM

29
#1033 - ciscomalware / @ciscomalware

07/07/2020 at 10:02PM

30
#1034 - Ashmonger / @ashmonger1337

02/24/2020 at 01:53PM

30
#1035 - Kim Hwa Joong / @hanmwoi

03/18/2020 at 07:00PM

30
#1036 - Kiran Kumar Manku / @kirankumarmanku

03/27/2020 at 11:30PM

30
#1037 - Max Well / @temp2004it

04/23/2020 at 07:19AM

30
#1038 - Ved Verma / @dearved

06/01/2020 at 01:00AM

31
#1039 - anass belcaid / @anassbelcaid1

05/02/2020 at 11:21AM

31
#1040 - nick / @WhatsUpNickDown

05/11/2020 at 02:58AM

31
#1041 - lingze / @_lingze

06/27/2020 at 04:18PM

31
#1042 - binayak tiwari / @bintiw

08/03/2020 at 12:53AM

32
#1043 - Kalbir / @proustian

04/27/2020 at 10:12PM

33
#1044 - rolando / @ro1_ando

03/30/2020 at 09:50PM

33
#1045 - Rudolf Scherman / @rudolf_scherman

06/12/2020 at 08:45AM

34
#1046 - John Smith / @JohnSmi89587373

05/19/2020 at 08:36PM

34
#1047 - brianhotopp / @brianhotopp

07/20/2020 at 11:31PM

35
#1048 - steve bolo / @steve_bolo

02/26/2020 at 09:43PM

35
#1049 - Marta / @AruizMarta

04/22/2020 at 04:01PM

35
#1050 - Paul Rodgers / @oursjaune

05/08/2020 at 08:26PM