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

899 active golfers, 3779 entries

Leaderboard (lowest score wins):
11
#301 - Rodrigo V. Lopes / @rodvlopes

03/22/2020 at 07:03PM

11
#302 - Quark / @PuzzleQuark

03/22/2020 at 07:27PM

11
#303 - Global Maquereau / @GlobalMaquereau

03/23/2020 at 06:40AM

11
#304 - Costel Radulescu / @_wizard_

03/23/2020 at 10:42PM

11
#305 - agricantare / @agricantare

03/25/2020 at 06:46AM

11
#306 - BartJanssen / @BartJanssen

03/25/2020 at 08:40AM

11
#307 - eshel / @EshelBM

03/25/2020 at 07:06PM

11
#308 - Alexander / @Alexand64026860

03/26/2020 at 06:37PM

11
#309 - tinyfat / @tanghaijun12345

03/27/2020 at 09:12AM

11
#310 - Amado Antonini / @AmadoAntonini

03/29/2020 at 11:50AM

11
#311 - Ray Guan / @guanxi555

03/30/2020 at 02:49AM

11
#312 - RaylanFox / @RaylanFox

04/05/2020 at 08:03AM

11
#313 - Chris Fowler / @ChrisFowler3

04/05/2020 at 11:44AM

11
#314 - Seve / @__Seve__

04/09/2020 at 04:06PM

11
#315 - Kelvin Meyer / @Kelvin_Meyer15

04/10/2020 at 08:51AM

11
#316 - ErQ325 / @EQ325

04/10/2020 at 09:55AM

11
#317 - Kumar Ankur / @k_ankur

04/10/2020 at 06:42PM

11
#318 - couaber / @couaber

04/11/2020 at 04:13PM

11
#319 - tacrof / @TacFuji

04/12/2020 at 02:25AM

11
#320 - Karl / @kebradshaw

04/12/2020 at 04:22PM

11
#321 - ProcessingTest / @ProcessingTest1

04/12/2020 at 08:50PM

11
#322 - Simone Cimarelli / @aquilairreale

04/16/2020 at 10:55PM

11
#323 - Ivan Volosyuk / @IvanVolosyuk

04/18/2020 at 03:56PM

11
#324 - Márcio Santos / @m4rciosantos

04/18/2020 at 10:57PM

11
#325 - Yianni Giannaris / @YGiannaris

04/19/2020 at 01:57AM

11
#326 - まーしぃ🐢💨 / @marcymaplemug

04/22/2020 at 12:05PM

11
#327 - Wesley Runnels / @wesleyrunnels

04/23/2020 at 01:11AM

11
#328 - Rob Pilling / @bobrippling

04/23/2020 at 08:23AM

11
#329 - Stian Selnes / @stianse

04/23/2020 at 12:35PM

11
#330 - Cristian Cazacu / @kryshac

04/23/2020 at 08:28PM