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, 5804 entries

Leaderboard (lowest score wins):
12
#691 - Michael / @thscuriousquest

02/21/2020 at 03:55AM

12
#692 - Jamie Houston / @silvyn

02/25/2020 at 03:38PM

12
#693 - Avery Wilkening / @awilkening

02/25/2020 at 03:49PM

12
#694 - Marcin Gramza / @temperski

02/25/2020 at 09:51PM

12
#695 - Clint Caudle / @ClintCaudle

02/28/2020 at 06:01PM

12
#696 - Sanchez / @r0756108

03/11/2020 at 10:22AM

12
#697 - BESSENG A IREH Guy / @guybesseng

03/13/2020 at 04:30PM

12
#698 - Greger Cronquist / @gregerc

03/16/2020 at 09:59PM

12
#699 - BnnGolfer / @BnnGolfer

03/19/2020 at 10:02PM

12
#700 - Shivam Sharma / @getshivam

03/23/2020 at 07:22PM

12
#701 - Victor Ramirez / @virako

04/01/2020 at 10:07AM

12
#702 - yyang / @yyang25803679

05/01/2020 at 04:18PM

12
#703 - dule2607 / @dule26071

05/02/2020 at 11:17AM

12
#704 - Raphael / @Console64

05/05/2020 at 08:49AM

12
#705 - Jan Fiser / @dmmn082

05/08/2020 at 08:26AM

12
#706 - Jeff Cui / @jeffacce

05/12/2020 at 06:56AM

12
#707 - Jimmy Tang / @moosekk

05/14/2020 at 09:36PM

12
#708 - 𝓂𝒿𝓇 βˆ‹ ℝ / @real_mjr

05/21/2020 at 08:47AM

12
#709 - Kachyz Estrada / @KachyzMX

05/25/2020 at 04:02PM

12
#710 - ajh / @AlexJHammel

05/26/2020 at 06:31PM

12
#711 - Jackie / @Jackie57887507

06/02/2020 at 03:41AM

12
#712 - εΊ—ι•· / @_shop_one

06/16/2020 at 05:50AM

12
#713 - soundscope / @__soundscope__

06/29/2020 at 08:29AM

12
#714 - Nolan Freeman / @NolanFreeman

07/01/2020 at 08:01AM

12
#715 - Justin Or / @just_in_awe

07/04/2020 at 04:31AM

12
#716 - ᕦ( Ν‘Β° ΝœΚ– Ν‘Β°)α•€ / @eduardoarandah

07/10/2020 at 07:21PM

12
#717 - Mens Jender / @Todesshnizzle

07/23/2020 at 12:54PM

12
#718 - uakci / @uakshi

07/29/2020 at 04:15PM

12
#719 - Golf Gopher / @GolfGopher3

08/17/2020 at 12:58PM

12
#720 - Put me on your list tyrants / @electronjunkie

08/19/2020 at 01:22PM