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 1433 remaining solutions by signing in and submitting your own entry
#1434 撁(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

1434 active golfers, 5829 entries

Leaderboard (lowest score wins):
21
#1231 - yoyi / @vaporyhumo

04/27/2020 at 05:23AM

21
#1232 - Axel / @Axel07930943

05/05/2020 at 04:19AM

21
#1233 - Bas van den Wollenberg / @basvdwollenberg

05/10/2020 at 04:35PM

21
#1234 - Jorge Romeu Huidobro / @jorgerom_

05/12/2020 at 04:02PM

21
#1235 - Pettsonator / @Pettsonator

05/23/2020 at 08:13PM

21
#1236 - Regis A. Ely / @regisaely

06/20/2020 at 11:34PM

21
#1237 - humpadumpa / @humpadumpa2

06/26/2020 at 08:54PM

21
#1238 - Dzmitry Brutski / @BrutskiDzmitry

06/28/2020 at 12:05PM

21
#1239 - Josivan Joestar πŸ‡ΊπŸ‡³πŸŒŽπŸš€ / @MedeirosJosivan

07/21/2020 at 05:22PM

21
#1240 - drGsus / @drGsus

07/24/2020 at 04:54PM

21
#1241 - notadevCollins / @NotadevC

08/11/2020 at 12:51AM

21
#1242 - Sharad Mishra / @BeMishra

08/14/2020 at 03:34AM

21
#1243 - θ”£ζ˜€εŠ­ / @hjtiun852

09/01/2020 at 02:56PM

21
#1244 - Bart Barnard / @BartBarnard

09/07/2020 at 06:30AM

21
#1245 - Emil Abraham / @emil1414

09/19/2020 at 08:02PM

21
#1246 - Danger00Dan / @Danger00D

09/25/2020 at 01:22AM

21
#1247 - stefan dye / @stefandye

11/20/2020 at 11:04AM

21
#1248 - Leo sunil / @tomyail

12/07/2020 at 05:52AM

21
#1249 - Laura Skillington / @lauraskills1

12/08/2020 at 09:26PM

21
#1250 - david / @david52856086

12/17/2020 at 12:48AM

21
#1251 - kris welsh / @kriswelsh

01/04/2021 at 11:20PM

21
#1252 - Marcin Doliwa / @mdoliwa

01/11/2021 at 09:02PM

21
#1253 - Harshit Hajela / @HarshitHajela

04/09/2021 at 12:42AM

22
#1254 - Jon Woodlief / @JonWoodlief

02/21/2020 at 06:05PM

22
#1255 - Magnetic Spark / @Magnetic_Spark

02/22/2020 at 02:05AM

22
#1256 - Patrick Motard / @PatrickMotard

02/22/2020 at 02:23AM

22
#1257 - mok____ / @mok92245249

02/26/2020 at 07:36AM

22
#1258 - Jonathan.N.Carrot / @JonathanNCarrot

02/27/2020 at 07:43AM

22
#1259 - Vladyslav Siriniok and $2 Wine / @siriniok

03/02/2020 at 12:11PM

22
#1260 - سید [v] / @vforvaricocele

03/08/2020 at 03:52PM