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

799 active golfers, 3341 entries

Leaderboard (lowest score wins):
12
#391 - Jan Fiser / @dmmn082

05/08/2020 at 08:26AM

12
#392 - Jeff Cui / @jeffacce

05/12/2020 at 06:56AM

12
#393 - Jimmy Tang / @moosekk

05/14/2020 at 09:36PM

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

05/21/2020 at 08:47AM

12
#395 - Kachyz Estrada / @KachyzMX

05/25/2020 at 04:02PM

12
#396 - ajh / @AlexJHammel

05/26/2020 at 06:31PM

12
#397 - Jackie / @Jackie57887507

06/02/2020 at 03:41AM

12
#398 - C++γγ‚“οΌˆε…ƒεΊ—ι•·οΌ‰ / @_shop_one

06/16/2020 at 05:50AM

12
#399 - soundscope / @__soundscope__

06/29/2020 at 08:29AM

12
#400 - Nolan Freeman / @NolanFreeman

07/01/2020 at 08:01AM

12
#401 - Justin Or / @just_in_awe

07/04/2020 at 04:31AM

13
#402 - γ—γΎγ˜γ‚ƒγ / @obknt

02/28/2020 at 04:52PM

13
#403 - Andre Cato / @DreBear800

02/29/2020 at 04:37PM

13
#404 - Taeer Bar-Yam / @sjOrrit

03/02/2020 at 07:35PM

13
#405 - Yogesh Lonkar / @yogeshlor

03/28/2020 at 07:50PM

13
#406 - Josa Gesell / @josa_

03/31/2020 at 09:51PM

13
#407 - kajman / @kajman87

04/02/2020 at 05:32AM

13
#408 - nope / @TotNotTac

04/07/2020 at 02:34PM

13
#409 - ag / @tickerfiles

04/14/2020 at 08:28AM

13
#410 - Justin Liu / @j10

04/15/2020 at 11:48PM

13
#411 - Madelyn Freed / @EcoBummer

04/22/2020 at 03:21PM

13
#412 - John Blackbeard / @myblackbeard

04/22/2020 at 08:09PM

13
#413 - The Legy / @thelegy

04/23/2020 at 10:36AM

13
#414 - Surya / @Surya01423017

04/26/2020 at 05:39PM

13
#415 - Raw Cotton / @rawcottonindia

04/30/2020 at 11:00AM

13
#416 - ι™ˆεŠ²ζΎ / @1144154299

05/15/2020 at 03:51AM

13
#417 - pady. πŸ‡ͺπŸ‡Ί πŸ‡©πŸ‡ͺ πŸ‡·πŸ‡΄ / @hundertzwoelf_

05/20/2020 at 03:09PM

13
#418 - γŠγ‚γ‹ / @ork055

05/21/2020 at 03:22AM

13
#419 - yanisdebusschere@gmail.com / @db_yanis

05/26/2020 at 05:42PM

13
#420 - loupiot.veloce / @LoupiotVeloce

05/29/2020 at 10:15PM