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):
36
#1411 - Petros Kapakos / @dapetros

05/08/2020 at 06:04PM

36
#1412 - Casimer Cegelski / @CasimerCegelski

09/25/2020 at 09:09PM

36
#1413 - Wojciech Matuszewski / @wm_matuszewski

01/03/2021 at 05:15AM

37
#1414 - Айбек Муратбеков / @mr_fourblack

05/15/2020 at 10:04AM

37
#1415 - Kevin Linnane / @linnanekevin07

12/30/2020 at 04:54PM

37
#1416 - Tracing / @Tracing47202686

03/18/2021 at 07:19AM

38
#1417 - Jakub Iwanowski / @Jakub30399498

03/07/2020 at 11:53PM

38
#1418 - kijete3127 / @kijete3127

12/13/2020 at 01:24PM

41
#1419 - 𝚕𝚘𝚛𝚍 / @padulkemid

03/11/2020 at 07:18PM

41
#1420 - kenotaph / @kenotaph

09/02/2020 at 10:04AM

42
#1421 - tengrui / @Rui_Teng

08/04/2020 at 12:04PM

45
#1422 - giahuydo99 / @giahuydo99

05/28/2020 at 05:16AM

47
#1423 - Sergio Soares / @sergsoares

04/21/2020 at 09:58PM

50
#1424 - Pranshu Gaba / @PranshuGaba

04/13/2020 at 11:37AM

50
#1425 - { allan serna } / @allaneserna

06/22/2020 at 03:43AM

50
#1426 - e / @thestudygoddess

11/16/2020 at 06:17AM

50
#1427 - Maria Soleim / @pepsimaxhei

01/09/2021 at 07:16PM

57
#1428 - mahmoux 🏳️‍🌈 🎗 / @3to1dash

06/26/2020 at 09:15AM

65
#1429 - popexizhi / @popexizhi

04/16/2021 at 08:59AM

71
#1430 - grug / @_grug

03/19/2020 at 06:04PM

113
#1431 - migel1976 / @migel19760103

05/20/2020 at 08:18PM

142
#1432 - Victor-IsmaelReeves / @VIsmaelreeves

10/23/2020 at 01:32PM

375
#1433 - yuhung / @koba_taiwan

12/25/2020 at 05:46AM

421
#1434 - 梁(Liang リャン) / @starduliang

03/01/2020 at 11:54AM