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
#961 - Chris Thompson / @ctmusicnz

07/24/2020 at 04:00AM

16
#962 - Shrutesh Patil / @patil_shrutesh

08/01/2020 at 07:50PM

16
#963 - ぼとぼと / @boto_voto

08/02/2020 at 07:06AM

16
#964 - qisnotnq / @qisnotnq

08/10/2020 at 02:48PM

16
#965 - Chongchong He / @chongchonghe

08/12/2020 at 04:08PM

16
#966 - Sergio / @SergioVl12

08/16/2020 at 04:53AM

16
#967 - santrupta mishra / @talkedgrain8

08/19/2020 at 07:01AM

16
#968 - Luis Rodriguez / @luisthecoder

08/19/2020 at 12:34PM

16
#969 - serici / @serici

08/20/2020 at 01:38PM

16
#970 - Alex Daum / @JustBeAwesomer

08/21/2020 at 12:01PM

16
#971 - Marcio M Pereira / @iviarcio

08/23/2020 at 02:48AM

16
#972 - teo / @TeofilC

08/29/2020 at 04:35PM

16
#973 - Luc Kien Hang / @luckienhang

09/03/2020 at 05:08AM

16
#974 - Ryan / @ryan_lardinois

09/06/2020 at 01:14AM

16
#975 - kofls / @kofls4

09/06/2020 at 09:57AM

16
#976 - Kaustubh Murumkar / @k_austub_h

09/21/2020 at 02:14PM

16
#977 - Sebastien Baudray / @sbaudray

09/25/2020 at 02:25AM

16
#978 - Konrad Heidler / @koheidler

10/02/2020 at 09:28AM

16
#979 - Ben Wainwright / @benwainwrightuk

10/02/2020 at 11:20AM

16
#980 - Francisco Krause / @FranciscoKrause

10/07/2020 at 08:51PM

16
#981 - Gleb Zaharov / @maerfix

10/11/2020 at 08:33AM

16
#982 - The Valencian Dev / @thevalenciandev

10/11/2020 at 10:42AM

16
#983 - rr / @rodgeur31

10/14/2020 at 09:14PM

16
#984 - Michael Anckaert / @MichaelAnckaert

10/15/2020 at 03:00PM

16
#985 - Markus Aspegren / @Markuso213

10/16/2020 at 05:29PM

16
#986 - Jakub Wagner / @Jakub1019

10/22/2020 at 09:09AM

16
#987 - Nathan Iszlaub / @NIszlaub

11/06/2020 at 07:43AM

16
#988 - Matthew Karcher / @mattrfk

11/19/2020 at 03:05AM

16
#989 - CAMARASA Robin / @CamarasaRobin

11/22/2020 at 06:02PM

16
#990 - Arne Winter / @ArneWinter5

12/06/2020 at 11:05PM