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

1085 active golfers, 4501 entries

Leaderboard (lowest score wins):
13
#571 - Aldo Doggen / @ALDOGGEN

06/06/2020 at 11:41AM

13
#572 - Marco Meyer / @marcomeyerVFX

06/07/2020 at 11:30AM

13
#573 - Sam Kim / @samkimhis

06/24/2020 at 07:36AM

13
#574 - Ali Aslan / @AliAsla95742367

07/01/2020 at 05:45AM

13
#575 - Remy_Clarke / @_Remy_Clarke_

07/15/2020 at 05:35PM

13
#576 - Terry Vogelsang / @terryvogelsang

08/03/2020 at 02:07PM

13
#577 - 李华楠 / @LeeOhanan

08/18/2020 at 10:25AM

13
#578 - ne0-1 / @ne0_01

08/28/2020 at 12:57PM

13
#579 - Miki Tebeka / @tebeka

08/31/2020 at 06:51AM

13
#580 - EnigmaBot / @OffTheRecordBot

09/17/2020 at 09:07AM

13
#581 - Winterburn / @Winterburned

09/18/2020 at 08:18AM

14
#582 - CJ Avilla / @wizemanip

02/29/2020 at 10:55PM

14
#583 - エターナル雑魚 / @eternalzako

03/07/2020 at 09:21AM

14
#584 - averageRandomPerson / @averageRandomP1

03/08/2020 at 10:51PM

14
#585 - Корнев Руслан / @woto7

03/09/2020 at 02:28PM

14
#586 - Rune Warhuus / @DinkDonkNorway

03/25/2020 at 06:11PM

14
#587 - Agustino Thadeus / @agustinothadeus

03/25/2020 at 09:42PM

14
#588 - Carl Smestad / @CarlSmes

03/29/2020 at 07:40PM

14
#589 - rg thomas / @rgt47

03/31/2020 at 12:58AM

14
#590 - vimmer / @vimmer14

04/15/2020 at 02:22PM

14
#591 - Samuel Bernheim / @sambernheim

04/22/2020 at 05:14AM

14
#592 - sherman / @sherman37029653

04/27/2020 at 02:13AM

14
#593 - David Bragmark / @DBragmark

04/28/2020 at 06:52PM

14
#594 - のあべるぐ / @n04ln

05/02/2020 at 04:12PM

14
#595 - Tom Firth / @tdfirth

05/08/2020 at 10:14AM

14
#596 - Marty Boren / @beanmaximalist

05/12/2020 at 06:42PM

14
#597 - Manish Baghel / @ManishBaghelz

05/12/2020 at 09:50PM

14
#598 - Gatlee / @gatlee

05/18/2020 at 08:23AM

14
#599 - Salman AlSaigal / @Salman_AlSaigal

05/20/2020 at 12:09AM

14
#600 - NGM / @gmnimrod1

05/21/2020 at 09:58AM