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):
19
#1111 - Shalin Scupham / @shalin_scupham

04/21/2020 at 02:25AM

19
#1112 - kanye west's vas deferens / @gayshot27

05/11/2020 at 05:23AM

19
#1113 - Bonamanada / @Bonamanada

05/11/2020 at 08:25AM

19
#1114 - social distancing before it was cool / @wrmrx

05/11/2020 at 08:43PM

19
#1115 - Sebastian / @dersharky

05/13/2020 at 02:29PM

19
#1116 - Parthasarathi Khirwadkar / @ParthKhirwadkar

05/13/2020 at 03:50PM

19
#1117 - chan hong iq / @IqHong

05/25/2020 at 04:24AM

19
#1118 - Brent / @PRFNTX

05/27/2020 at 03:14PM

19
#1119 - Harry Doran / @harrydorandev

06/02/2020 at 03:11PM

19
#1120 - pheeria / @pheeria

06/15/2020 at 08:58PM

19
#1121 - Jacob Shomstein / @jshoms

06/16/2020 at 03:18AM

19
#1122 - 鏡崎ましろ / @KagamisakiMsr

06/16/2020 at 07:35AM

19
#1123 - infinitesimal being 🎮 / @hydr063n

06/20/2020 at 08:57PM

19
#1124 - hisham maged / @hisham_maged

06/27/2020 at 12:20PM

19
#1125 - Mikail Khan / @PM_ME_CAT_GIFS

07/02/2020 at 01:41PM

19
#1126 - L Z / @unidevel

07/05/2020 at 12:59AM

19
#1127 - Guillaume leon / @Le_Zappellin

07/14/2020 at 11:54PM

19
#1128 - Pat Haggerty / @HaggertyPat

08/24/2020 at 12:15PM

19
#1129 - alrito / @alrito6

09/01/2020 at 03:54PM

19
#1130 - Robert Verst / @r_verst

09/02/2020 at 11:00AM

19
#1131 - Just Alerik / @Just_Alerik

09/17/2020 at 05:18PM

19
#1132 - William Burns / @_william_burns

09/28/2020 at 07:42PM

19
#1133 - just here to scroll. / @idontknow0001

10/03/2020 at 12:02PM

19
#1134 - Ahmet Said AK / @asaidak

10/18/2020 at 08:10PM

19
#1135 - Marcos Filho / @malbertoifi

11/05/2020 at 06:48PM

19
#1136 - Matt Milliron / @valueiron

11/27/2020 at 09:48AM

19
#1137 - Gabe / @Gabe74053768

12/10/2020 at 02:09PM

19
#1138 - Bharath / @Bharath15952517

12/12/2020 at 05:53PM

19
#1139 - Oscar Bailey / @oscarb_xyz

12/16/2020 at 12:53PM

19
#1140 - altamente / @altamnt

12/17/2020 at 10:59AM