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

1428 active golfers, 5804 entries

Leaderboard (lowest score wins):
14
#781 - vimmer / @vimmer14

04/15/2020 at 02:22PM

14
#782 - Samuel Bernheim / @sambernheim

04/22/2020 at 05:14AM

14
#783 - sherman / @sherman37029653

04/27/2020 at 02:13AM

14
#784 - David Bragmark / @DBragmark

04/28/2020 at 06:52PM

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

05/02/2020 at 04:12PM

14
#786 - Tom Firth / @tdfirth

05/08/2020 at 10:14AM

14
#787 - Marty Boren / @beanmaximalist

05/12/2020 at 06:42PM

14
#788 - Manish Baghel / @ManishBaghelz

05/12/2020 at 09:50PM

14
#789 - Gatlee / @gatlee

05/18/2020 at 08:23AM

14
#790 - Salman AlSaigal / @Salman_AlSaigal

05/20/2020 at 12:09AM

14
#791 - NGM / @gmnimrod1

05/21/2020 at 09:58AM

14
#792 - Pratik Patil / @prtk314

05/22/2020 at 06:07PM

14
#793 - 무진 / @svperstarz

05/29/2020 at 03:12PM

14
#794 - Tom BP / @ThosBP

06/16/2020 at 09:09AM

14
#795 - Daniel Vinciguerra / @dvinciguerra

06/16/2020 at 10:09PM

14
#796 - Felix / @motorente

06/24/2020 at 08:26AM

14
#797 - Siim Põder / @siimphh

07/04/2020 at 09:35AM

14
#798 - Ferran / @ferran_marlet

07/12/2020 at 03:23PM

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

07/15/2020 at 06:21PM

14
#800 - Tosoa Bacca / @elsifaka

07/16/2020 at 02:29PM

14
#801 - Benjamin Turner / @passionsplay

07/21/2020 at 03:39AM

14
#802 - Valvin / @_valvin

08/04/2020 at 08:45PM

14
#803 - Thiago Becker 😷 / @beckert

08/06/2020 at 11:54AM

14
#804 - Ankit Saini / @AnkitSa07105520

08/12/2020 at 05:00AM

14
#805 - Gustavo C. Martins / @gustavocm

08/14/2020 at 11:55AM

14
#806 - Mischief manager / @sunamur

08/20/2020 at 04:33PM

14
#807 - Nathan Hollows / @nathanhollows

08/20/2020 at 10:34PM

14
#808 - Johnny Lawrence / @CobraKaiOrDie

08/23/2020 at 04:03AM

14
#809 - Nick Kirkby / @driftregion

08/29/2020 at 02:35PM

14
#810 - FunkyKoval / @FunkyKoval10

09/04/2020 at 08:30PM