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):
14
#601 - Pratik Patil / @prtk314

05/22/2020 at 06:07PM

14
#602 - 무진 / @svperstarz

05/29/2020 at 03:12PM

14
#603 - Tom BP / @ThosBP

06/16/2020 at 09:09AM

14
#604 - Daniel Vinciguerra / @dvinciguerra

06/16/2020 at 10:09PM

14
#605 - Felix / @motorente

06/24/2020 at 08:26AM

14
#606 - Siim Põder / @siimphh

07/04/2020 at 09:35AM

14
#607 - Ferran / @ferran_marlet

07/12/2020 at 03:23PM

14
#608 - Option::Some("Mike Cluck") / @MikeCluck

07/15/2020 at 06:21PM

14
#609 - Tosoa Bacca / @elsifaka

07/16/2020 at 02:29PM

14
#610 - Benjamin Turner / @passionsplay

07/21/2020 at 03:39AM

14
#611 - Valvin / @_valvin

08/04/2020 at 08:45PM

14
#612 - Thiago Becker / @beckert

08/06/2020 at 11:54AM

14
#613 - Ankit Saini / @AnkitSa07105520

08/12/2020 at 05:00AM

14
#614 - Gustavo C. Martins / @gustavocm

08/14/2020 at 11:55AM

14
#615 - Mischief manager / @sunamur

08/20/2020 at 04:33PM

14
#616 - Nathan Hollows / @nathanhollows

08/20/2020 at 10:34PM

14
#617 - Johnny Lawrence / @CobraKaiOrDie

08/23/2020 at 04:03AM

14
#618 - Nick Kirkby / @driftregion

08/29/2020 at 02:35PM

14
#619 - FunkyKoval / @FunkyKoval10

09/04/2020 at 08:30PM

14
#620 - Julian Geiger / @JulianGeiger14

09/11/2020 at 10:03AM

14
#621 - Johan Arrhen / @JoPeArrhen

09/19/2020 at 10:27AM

14
#622 - Fransis / @fransisnk

09/23/2020 at 09:57PM

14
#623 - " / @bluugs

09/25/2020 at 06:28PM

14
#624 - Brendan Schaenzer / @bschaenzer

09/29/2020 at 07:11PM

15
#625 - Nihil / @Nihil3

02/21/2020 at 07:46PM

15
#626 - Alan Kessler / @alankesslr

02/22/2020 at 05:43AM

15
#627 - Chris League / @chrisleague

02/22/2020 at 09:08PM

15
#628 - Emil / @emilklindt

02/22/2020 at 11:10PM

15
#629 - Bennett / @bennettbackward

02/24/2020 at 04:01AM

15
#630 - out of cache / @outofcache

02/25/2020 at 12:31PM