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):
20
#631 - Ishi / @HalloWard1

03/08/2020 at 09:39AM

20
#632 - Andrew Farries / @surjection123

03/19/2020 at 02:36PM

20
#633 - Nguyen Van Bac / @taybacvt

03/20/2020 at 03:54PM

20
#634 - Joe Farnsworth / @JoeFarnsworth

03/23/2020 at 01:16AM

20
#635 - ぬるー / @_Nururin

03/24/2020 at 05:49AM

20
#636 - antipattern / @antipattern5

03/28/2020 at 09:44PM

20
#637 - Novsirion / @novsirion

03/30/2020 at 01:56PM

20
#638 - Atzz / @AtzzCokeK

04/05/2020 at 09:30AM

20
#639 - Кунин Александр / @skyksandr

04/16/2020 at 04:47PM

20
#640 - iobtl / @iobtl2

04/18/2020 at 09:02AM

20
#641 - Francsico / @Francsi31459977

04/18/2020 at 01:02PM

20
#642 - sabinmaharjan40@gmail.com / @sabinmaharjan40

04/19/2020 at 07:42AM

20
#643 - Sabrina Seibel / @seibelsabrina

04/21/2020 at 04:23AM

20
#644 - GenericHardwareGamer / @GnrikHrdwrGamer

04/22/2020 at 11:02AM

20
#645 - YTREWQ / @userytrewq

04/23/2020 at 01:00AM

20
#646 - Robin Abrahamsson / @rqAbrahamsson

04/29/2020 at 10:57AM

20
#647 - john / @john99857791

05/07/2020 at 01:47AM

20
#648 - Darren Brien / @darrenkbrien

05/12/2020 at 02:53PM

20
#649 - 翼士六高达 / @9dTFbiwyHjPmSY9

05/13/2020 at 11:31AM

20
#650 - She3o at HOME / @Anas_She3sha3y

05/18/2020 at 08:57AM

20
#651 - Jean-Charles Quillet / @jc_jecaro

05/19/2020 at 02:58PM

20
#652 - Wesley May / @wjomlex

05/22/2020 at 03:21AM

20
#653 - bigsystem / @bigsystem2

05/28/2020 at 02:23PM

20
#654 - El-Tabei / @eltabei_m

05/29/2020 at 09:22PM

20
#655 - natasha / @CallMeNatchos

05/31/2020 at 09:51PM

20
#656 - Cassio / @cassiobatista

06/03/2020 at 12:42AM

20
#657 - Jules / @namebrandloser

06/11/2020 at 07:05PM

20
#658 - Axel Yung / @axelyung

06/14/2020 at 11:25PM

20
#659 - Isaac Pohl-Zaretsky / @IsaacPZZ

06/15/2020 at 04:56AM

20
#660 - Mruczek / @mruczek1337

06/20/2020 at 12:27AM