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):
15
#871 - Patrick Weigert / @PatrickWeigert

05/31/2020 at 11:47PM

15
#872 - Luke Parsons / @lukeparsons

06/02/2020 at 04:55PM

15
#873 - MA Calero / @GaleonCalero

06/07/2020 at 05:18PM

15
#874 - candywrappercrane / @cndwrpprpprcrn

06/11/2020 at 08:18PM

15
#875 - よっぴ / @yoppinbass

06/14/2020 at 09:26AM

15
#876 - Christian Bay / @the_greenbourne

06/19/2020 at 11:29AM

15
#877 - Vinícius Hoyer / @viniciushoyer

07/03/2020 at 02:17PM

15
#878 - Rishabh Dwivedi / @Rishabh45312910

07/03/2020 at 06:39PM

15
#879 - vito / @vito49999722

07/11/2020 at 08:47PM

15
#880 - LCY / @Chooneh

07/15/2020 at 09:15AM

15
#881 - sf_lifestyle / @sflifestyle1

07/20/2020 at 01:38AM

15
#882 - Lorenz Leitner / @LorenzLeitner

07/26/2020 at 01:28PM

15
#883 - Ben MERTZ / @BenMERTZ3

08/07/2020 at 06:11PM

15
#884 - Tiberius Rex / @mr_tiberius_rex

08/11/2020 at 03:26PM

15
#885 - Burt Burton / @BurtBurton6

08/18/2020 at 02:41PM

15
#886 - Captin_Seal / @pimenov_pavel

08/19/2020 at 09:04AM

15
#887 - Leonard Wagner / @leonard2997

08/19/2020 at 12:31PM

15
#888 - AutumnalAntlers / @AntlerBaskets

08/23/2020 at 02:50AM

15
#889 - Oben Özgür / @Obenozgur

08/24/2020 at 03:19PM

15
#890 - rye bread / @theryangeary

08/30/2020 at 08:37PM

15
#891 - Der Natsch / @dernatsch

09/05/2020 at 01:41PM

15
#892 - Dr Rev J. “I am not a bot!” Kirchartz, KSC, KHS / @JKirchartz

09/09/2020 at 12:46PM

15
#893 - Florian Duraffourg / @fduraffourg

09/14/2020 at 11:50AM

15
#894 - 邵俊杰 / @wEck7QA3M1OtFvD

09/22/2020 at 04:56AM

15
#895 - David Nuñez / @dnunez24

09/23/2020 at 03:48AM

15
#896 - antonix / @antonix

09/28/2020 at 02:41PM

15
#897 - Carsano / @DamienFbn

10/09/2020 at 02:34PM

15
#898 - R1 Bwre / @Erw_Bi

10/10/2020 at 03:30PM

15
#899 - Asbjørn Riddervold / @ARiddervold

10/11/2020 at 05:22PM

15
#900 - hhh / @hhh78116797

10/17/2020 at 12:17PM