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

799 active golfers, 3341 entries

Leaderboard (lowest score wins):
17
#571 - Tom / @CronutFacts

06/17/2020 at 02:09PM

17
#572 - Richard Lowe / @b0ggyb33

06/18/2020 at 07:15AM

17
#573 - Ben Mayoras / @Mayorasaurus

06/19/2020 at 01:11AM

17
#574 - Ishaan Verma / @n1trob4ct3r

06/19/2020 at 02:54PM

17
#575 - Colby Morrison / @ColburnMorrison

06/29/2020 at 01:57AM

17
#576 - Allan Kent / @allankent

06/30/2020 at 06:43PM

17
#577 - Ivan Krukov / @i_krukov

07/02/2020 at 01:14AM

17
#578 - Anton / @Zackushka

07/04/2020 at 09:05PM

18
#579 - Marian Minar (jr.) / @majamin

03/01/2020 at 02:35AM

18
#580 - brad / @bitsbybrad

03/04/2020 at 03:30AM

18
#581 - Caio Marcelo / @CaioMCG

04/06/2020 at 02:07AM

18
#582 - Kieran / @Kieran39992130

04/14/2020 at 07:47AM

18
#583 - Stefano Bettani / @StefanoBettani

04/14/2020 at 02:50PM

18
#584 - Matt Vaughn / @mattttvaughn

04/15/2020 at 04:57PM

18
#585 - volandkit / @volandkit

04/17/2020 at 07:11PM

18
#586 - Owen Ki / @owen_ki_dev

04/30/2020 at 02:47AM

18
#587 - Vikas Singh / @Vikas6257

05/02/2020 at 07:38PM

18
#588 - Dionysus / @user101user

05/03/2020 at 06:51PM

18
#589 - Pouya Rostam / @PouyaRostam

05/15/2020 at 05:31AM

18
#590 - lavacalechera / @lavacalechera14

05/15/2020 at 08:19PM

18
#591 - David Cherednik / @david_cherednik

05/22/2020 at 11:45AM

18
#592 - Knarkzel / @Knarkzel1

05/29/2020 at 02:42PM

18
#593 - JerryYe / @JerryYZP

05/31/2020 at 01:28PM

18
#594 - fedja golf / @FedjaGolf

06/05/2020 at 12:35PM

18
#595 - mohamed / @melsayed891

06/11/2020 at 10:58PM

18
#596 - Ed Leafe / @EdLeafe

06/15/2020 at 11:02PM

18
#597 - s4k4yume / @s4k4yume1

06/24/2020 at 04:03PM

19
#598 - Malachi Phillips / @Malachi72164202

03/01/2020 at 04:13PM

19
#599 - Sean Stoneburner / @StoneburnerSFW

03/02/2020 at 10:07AM

19
#600 - David A. Lyon / @dauglyon

03/03/2020 at 11:30PM