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):
16
#511 - bruiser / @bruiserwins

03/15/2020 at 02:00AM

16
#512 - Vitor / @vitorldfreitas

03/21/2020 at 09:09PM

16
#513 - John Doe / @JohnDoe77150954

03/21/2020 at 10:40PM

16
#514 - Nishanth Reddy / @Nishanth2066

03/27/2020 at 10:44AM

16
#515 - Emanuele Aliverti / @memeAliverti

04/07/2020 at 03:52PM

16
#516 - Gerhard S / @Gerhard73484714

04/11/2020 at 11:52PM

16
#517 - Graham Parsons / @grpieces

04/13/2020 at 11:47AM

16
#518 - スペー / @homander2017

04/18/2020 at 01:01AM

16
#519 - Sabin maharjan / @Sabinma86681681

04/19/2020 at 07:48AM

16
#520 - edwardbaeg / @edwardbaeg

04/29/2020 at 11:45PM

16
#521 - andmpr / @andmpr1

05/01/2020 at 08:23AM

16
#522 - Rand Omperson / @197258444

05/03/2020 at 06:59PM

16
#523 - Daniel Power / @DanielPowerNL

05/04/2020 at 05:09AM

16
#524 - Morten Paulsen / @MortenP96

05/06/2020 at 11:43PM

16
#525 - Lee Saville / @LeeSaville

05/09/2020 at 02:53AM

16
#526 - Murali Patteboyina / @marxpert

05/19/2020 at 11:51AM

16
#527 - Chris Young / @shric

05/27/2020 at 11:56AM

16
#528 - blue christ / @bluechrist3

05/27/2020 at 07:28PM

16
#529 - Rishi Javia / @RishiJavia

06/01/2020 at 06:51PM

16
#530 - zqi / @zq11110320

06/02/2020 at 08:40AM

16
#531 - Saher El-Neklawy / @saherneklawy

06/03/2020 at 07:33PM

16
#532 - Manke Derkel / @MankeDerkel

06/03/2020 at 09:06PM

16
#533 - Mike Kennelly / @MWJKennelly

06/11/2020 at 04:22AM

16
#534 - Martin / @Martin17545241

06/11/2020 at 08:29PM

16
#535 - adamvimgolf / @adamvimgolf

06/13/2020 at 04:12PM

16
#536 - Puj / @MrPuj

06/15/2020 at 01:40PM

16
#537 - ryo_n / @ryo_n

06/19/2020 at 08:00AM

16
#538 - Evelyn / @EvelynNekoChan

06/28/2020 at 02:45PM

16
#539 - Gabriela Pilegi / @gabipilegi

06/30/2020 at 04:22PM

16
#540 - h2g2guy / @h2g2guy

07/05/2020 at 07:06AM