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

1434 active golfers, 5829 entries

Leaderboard (lowest score wins):
23
#1321 - Maibritt Illner / @Maibritt_Illner

08/04/2020 at 06:04PM

23
#1322 - igb43773@eoopy.com / @igb43773

08/06/2020 at 05:20PM

23
#1323 - Patalacarbo / @Patalacarbo1

09/09/2020 at 08:52PM

23
#1324 - Adrien Atallah / @AdrienAtallah

09/16/2020 at 09:54PM

23
#1325 - dzungtran / @dzungtran89

09/18/2020 at 04:20PM

23
#1326 - Hoang Ho / @HoangHo32183538

09/25/2020 at 09:49PM

23
#1327 - Muradil / @Muradil71938308

10/20/2020 at 04:01PM

23
#1328 - Abhishek Sriraman / @asriraman

11/01/2020 at 10:01PM

23
#1329 - Edd Sansome / @casualc0der

12/19/2020 at 07:47PM

23
#1330 - lyiriyah / @lyiriyah

01/16/2021 at 05:03PM

23
#1331 - Pavlo Hadzheha / @PHadzheha

01/31/2021 at 04:34PM

23
#1332 - fff / @fff51460170

02/20/2021 at 06:08AM

24
#1333 - Ahmed Hasan / @ahmedrhasan

03/01/2020 at 04:21PM

24
#1334 - Гошка Иванов / @b_goshka

03/10/2020 at 09:35AM

24
#1335 - Muhammad Khalifa / @MKhalifaaaa

03/25/2020 at 02:01PM

24
#1336 - Łukasz Pawluczuk / @LukaszPawluczuk

04/06/2020 at 02:58PM

24
#1337 - Akshat Agarwal / @humancalico

05/04/2020 at 04:52PM

24
#1338 - Ashburn / @AshburnHeo

05/08/2020 at 03:01PM

24
#1339 - elmarco / @elmarco

05/10/2020 at 09:37AM

24
#1340 - Mustapha Hamoui / @Beirutspring

05/20/2020 at 12:56PM

24
#1341 - Jesus Efren Cabrera / @JesusEfrenCabre

06/27/2020 at 07:00PM

24
#1342 - sp / @s3141p

07/14/2020 at 08:22PM

24
#1343 - まえちゃんねる / @maechanneler

08/27/2020 at 12:22PM

24
#1344 - Serhiy Prikhodko / @mastersnetru

11/16/2020 at 09:14PM

25
#1345 - Rafael Gonzaga / @_rafaelgss

03/22/2020 at 01:21AM

25
#1346 - Miguel Acero / @MiguelBAcero

04/06/2020 at 09:36PM

25
#1347 - x / @am_zzz_zzz

05/11/2020 at 05:11AM

25
#1348 - Brian Greenhill / @bcgreenhill

05/15/2020 at 12:24PM

25
#1349 - Rupert K. / @rupertk

05/23/2020 at 08:31AM

25
#1350 - sunny / @pooisonner

05/27/2020 at 06:36AM