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, 5802 entries

Leaderboard (lowest score wins):
16
#991 - davisdude / @davisclaib

12/13/2020 at 04:16PM

16
#992 - MEschenbacher / @eschenbacher_m

12/19/2020 at 09:17PM

16
#993 - Sindri Pétur / @SindriPetur

12/31/2020 at 02:40AM

16
#994 - fray bauhaus / @BauhausFray

01/11/2021 at 05:54PM

16
#995 - Redwyne / @lordmelguityrel

01/18/2021 at 07:38PM

16
#996 - Thomas Lüdecke / @t0mM3k

01/21/2021 at 06:38AM

16
#997 - Selvaganapathy P / @canabady

02/19/2021 at 11:56AM

16
#998 - Linus Bergman / @LinusBergman8

04/30/2021 at 07:15AM

16
#999 - max / @max_vimaster

06/30/2021 at 09:31AM

17
#1000 - Alex Haynes / @Deseao

02/21/2020 at 04:44PM

17
#1001 - mat / @GrisMat_

02/23/2020 at 10:25PM

17
#1002 - Dmitriy Olshevskiy / @olshevskiy_dv

02/24/2020 at 09:52AM

17
#1003 - AtomToast / @AtomTo4st

02/26/2020 at 09:58PM

17
#1004 - Uncle Ben / @Uncle_BenJ

02/29/2020 at 08:08AM

17
#1005 - Victor Chen / @VictorC89422342

03/04/2020 at 08:17PM

17
#1006 - Cᴀʀʟᴏs Aᴎᴅʀᴇ / @CarlosDededison

03/14/2020 at 07:09PM

17
#1007 - nall / @nall

03/16/2020 at 02:35AM

17
#1008 - Coder's Crib / @storyb3atz

03/21/2020 at 08:21AM

17
#1009 - Edward Vear / @edward_vear

04/04/2020 at 12:38AM

17
#1010 - Axel M. / @PymZoR

04/11/2020 at 08:54PM

17
#1011 - Ryan Burmeister-Morrison / @rburmorrison

04/11/2020 at 11:35PM

17
#1012 - Michael V. / @mvivirito

04/16/2020 at 07:09AM

17
#1013 - Alice Benign / @AliceBenign

04/19/2020 at 02:12PM

17
#1014 - ウチコ / @memememomo

04/24/2020 at 12:36PM

17
#1015 - Iain Bromley / @iainbromley

04/25/2020 at 05:12AM

17
#1016 - ミツバ@東京 / @mitubaEX

04/30/2020 at 03:13PM

17
#1017 - James Raubenheimer / @jamzrob

05/03/2020 at 04:26AM

17
#1018 - Colby Brown / @colbyabrown

05/09/2020 at 05:13AM

17
#1019 - MagazinePosh / @mercadoposh

05/10/2020 at 01:34AM

17
#1020 - ☭☭☭☭☭🇧🇷☭☭☭☭☭ / @CoachComunista

05/13/2020 at 11:27PM