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

1558 active golfers, 6381 entries

Leaderboard (lowest score wins):
11
#721 - BumfuzzleGames / @BumfuzzleGames

01/18/2021 at 08:29AM

11
#722 - Dave Millican / @dave_millican

01/18/2021 at 09:41AM

11
#723 - Horst / @Horst91706815

01/18/2021 at 06:21PM

11
#724 - Ken Baldwin / @kenbald1

01/19/2021 at 04:29AM

11
#725 - S / @steed2005

01/19/2021 at 02:12PM

11
#726 - Xiao Wangwang / @WangwangXiao

01/19/2021 at 05:55PM

11
#727 - Adam Katz / @AdamKat40357638

01/20/2021 at 12:10PM

11
#728 - Richard Leigh Davies / @RichardDaviesAI

01/23/2021 at 02:27PM

11
#729 - OtterPy / @OtterPy

01/26/2021 at 02:28PM

11
#730 - Askhento / @Askhento1

01/27/2021 at 07:22PM

11
#731 - Fabrice BONNET / @FabriceBONNET6

04/29/2021 at 03:19PM

11
#732 - xing yang / @yangxing844

05/09/2021 at 03:40PM

11
#733 - huscarl / @huscarl6

05/20/2021 at 03:07PM

11
#734 - Yttriferous / @YttriferousDev

05/25/2021 at 08:38AM

11
#735 - vim_maxter / @MaxterVim

07/01/2021 at 08:59AM

11
#736 - Matrices Matlab #1 / @matrices_matlab

07/14/2021 at 11:24AM

11
#737 - Peter Pandorum / @PeterPandorum

08/08/2021 at 12:45PM

11
#738 - Michel Viktor / @tomkpz

08/10/2021 at 12:31AM

11
#739 - Christopher Williams / @chrstphrsnw

12/18/2021 at 07:26PM

11
#740 - rappenstein2 / @rappenstein2

01/12/2022 at 04:58PM

11
#741 - shahanavaz m / @shahanavazm

02/16/2022 at 02:52PM

11
#742 - Digang's 트위터 / @Digang_e

03/23/2022 at 05:38AM

11
#743 - ._. / @Katharsic

04/25/2022 at 04:43PM

11
#744 - Youssef Magdy / @youssef_magdy29

04/30/2022 at 09:16PM

11
#745 - Edoardo Signorini / @Edoars

05/05/2022 at 02:16PM

11
#746 - }(⇒){ / @TangerinePlank

06/18/2022 at 04:46AM

11
#747 - adrian / @adrian09610908

08/09/2022 at 03:16AM

11
#748 - Vincent W / @ZoloowW

08/31/2022 at 04:12PM

11
#749 - Kenny / @kennpq

09/13/2022 at 06:56AM

11
#750 - Jui Ulhas Dakhave / @JuiDakhave

09/25/2022 at 01:19AM