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):
13
#751 - おろか / @ork055

05/21/2020 at 03:22AM

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

05/26/2020 at 05:42PM

13
#753 - loupiot.veloce / @LoupiotVeloce

05/29/2020 at 10:15PM

13
#754 - Aldo Doggen / @ALDOGGEN

06/06/2020 at 11:41AM

13
#755 - Marco Meyer / @marcomeyerVFX

06/07/2020 at 11:30AM

13
#756 - Sam Kim / @samkimhis

06/24/2020 at 07:36AM

13
#757 - Ali Aslan / @AliAsla95742367

07/01/2020 at 05:45AM

13
#758 - Remy_Clarke / @_Remy_Clarke_

07/15/2020 at 05:35PM

13
#759 - Terry Vogelsang / @terryvogelsang

08/03/2020 at 02:07PM

13
#760 - 李华楠 / @LeeOhanan

08/18/2020 at 10:25AM

13
#761 - ne0-1 / @ne0_01

08/28/2020 at 12:57PM

13
#762 - Miki Tebeka / @tebeka

08/31/2020 at 06:51AM

13
#763 - EnigmaBot / @OffTheRecordBot

09/17/2020 at 09:07AM

13
#764 - Winterburn / @Winterburned

09/18/2020 at 08:18AM

13
#765 - Kieron Browne / @KieronBrowne1

10/06/2020 at 11:04AM

13
#766 - Álan Crístoffer / @acristoffers

10/26/2020 at 08:53PM

13
#767 - Dennis Chen / @Mailyfesux

11/12/2020 at 06:23AM

13
#768 - Bob / @Bob25621943

12/20/2020 at 02:40PM

13
#769 - Marcin Dostojewski / @MarcinekAGH

01/10/2021 at 01:58PM

13
#770 - Martin LOUAZEL / @Zbrahark

02/18/2021 at 07:47AM

13
#771 - Tim Clifford / @Tim19683

04/01/2021 at 04:42PM

13
#772 - wex / @wex12923175

04/02/2021 at 07:38AM

14
#773 - CJ Avilla / @wizemanip

02/29/2020 at 10:55PM

14
#774 - エターナル雑魚 / @eternalzako

03/07/2020 at 09:21AM

14
#775 - averageRandomPerson / @averageRandomP1

03/08/2020 at 10:51PM

14
#776 - Корнев Руслан / @woto7

03/09/2020 at 02:28PM

14
#777 - Rune Warhuus / @DinkDonkNorway

03/25/2020 at 06:11PM

14
#778 - Agustino Thadeus / @agustinothadeus

03/25/2020 at 09:42PM

14
#779 - Carl Smestad / @CarlSmes

03/29/2020 at 07:40PM

14
#780 - rg thomas / @rgt47

03/31/2020 at 12:58AM