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

1380 active golfers, 5671 entries

Leaderboard (lowest score wins):
27
#1321 - abhijeet patil / @abhijeetptl5

09/02/2020 at 04:30PM

27
#1322 - dvorak4tzx / @dvorak4tzx4

12/28/2020 at 04:40PM

27
#1323 - fff / @fff51460170

01/03/2021 at 09:31AM

28
#1324 - Alex / @heliophobicdude

04/16/2020 at 09:17PM

28
#1325 - scott mysliwy / @scott_mysliwy

06/02/2020 at 07:22AM

28
#1326 - Vincent Alegrete / @valegrete

06/12/2020 at 12:18AM

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

07/13/2020 at 04:19PM

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

08/07/2020 at 04:05AM

28
#1329 - gchain / @gchain7

08/21/2020 at 03:02PM

28
#1330 - Albrecht Uhlig / @AlbrechtUhlig

08/27/2020 at 05:40AM

28
#1331 - elif bicer / @elifbicer1

09/17/2020 at 10:46PM

28
#1332 - tyuktu / @tyuk_tu

11/20/2020 at 01:45AM

28
#1333 - Am Jam / @LoneJam

01/04/2021 at 02:43AM

29
#1334 - Adam Haynes / @camomonkeyboy

05/08/2020 at 12:17AM

29
#1335 - Joseph Car / @JosephCar14

05/19/2020 at 11:39PM

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

06/23/2020 at 02:19PM

29
#1337 - Ti / @TeeLaam

07/05/2020 at 05:24AM

29
#1338 - ciscomalware / @ciscomalware

07/07/2020 at 10:02PM

29
#1339 - moh ayaya / @AyayaMoh

10/26/2020 at 09:36PM

30
#1340 - Ashmonger / @ashmonger1337

02/24/2020 at 01:53PM

30
#1341 - Kim Hwa Joong / @hanmwoi

03/18/2020 at 07:00PM

30
#1342 - Kiran Kumar Manku / @kirankumarmanku

03/27/2020 at 11:30PM

30
#1343 - Max Well / @temp2004it

04/23/2020 at 07:19AM

30
#1344 - Ved Verma / @dearved

06/01/2020 at 01:00AM

31
#1345 - anass belcaid / @anassbelcaid1

05/02/2020 at 11:21AM

31
#1346 - nick / @WhatsUpNickDown

05/11/2020 at 02:58AM

31
#1347 - lingze / @_lingze

06/27/2020 at 04:18PM

31
#1348 - binayak tiwari / @bintiw

08/03/2020 at 12:53AM

32
#1349 - Kalbir / @proustian

04/27/2020 at 10:12PM

33
#1350 - rolando / @ro1_ando

03/30/2020 at 09:50PM