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

1434 active golfers, 5829 entries

Leaderboard (lowest score wins):
17
#1021 - Iain Bromley / @iainbromley

04/25/2020 at 05:12AM

17
#1022 - ミツバ@東京 / @mitubaEX

04/30/2020 at 03:13PM

17
#1023 - James Raubenheimer / @jamzrob

05/03/2020 at 04:26AM

17
#1024 - Colby Brown / @colbyabrown

05/09/2020 at 05:13AM

17
#1025 - MagazinePosh / @mercadoposh

05/10/2020 at 01:34AM

17
#1026 - ☭☭☭☭☭🇧🇷☭☭☭☭☭ / @CoachComunista

05/13/2020 at 11:27PM

17
#1027 - Prabhakar Chaudhary / @Prabhak04186807

05/26/2020 at 01:54AM

17
#1028 - Jay Silverman / @SilvermanJayE

05/27/2020 at 07:10PM

17
#1029 - Tuan Nguyen / @v3spyr

05/28/2020 at 07:21AM

17
#1030 - dl1991 / @dl19913

05/29/2020 at 05:12AM

17
#1031 - Suraj Donthi / @suraj_donthi

05/29/2020 at 03:52PM

17
#1032 - teoet6 / @teoet6

06/03/2020 at 06:50PM

17
#1033 - Καράτε Μόνο / @karate_mono

06/12/2020 at 08:36AM

17
#1034 - lzh / @ly_zhng

06/12/2020 at 11:39PM

17
#1035 - Tom / @CronutFacts

06/17/2020 at 02:09PM

17
#1036 - Richard Lowe / @b0ggyb33

06/18/2020 at 07:15AM

17
#1037 - Ben Mayoras / @Mayorasaurus

06/19/2020 at 01:11AM

17
#1038 - Ishaan Verma / @n1trob4ct3r

06/19/2020 at 02:54PM

17
#1039 - Allan Kent / @allankent

06/30/2020 at 06:43PM

17
#1040 - Ivan Krukov / @i_krukov

07/02/2020 at 01:14AM

17
#1041 - Anton / @Zackushka

07/04/2020 at 09:05PM

17
#1042 - WhatDo / @WhatDo10

07/21/2020 at 11:22AM

17
#1043 - Trevor Hulsman / @trevorhulsman

08/02/2020 at 07:50PM

17
#1044 - Robin Schütgens / @RobinSchuetgens

08/18/2020 at 06:31PM

17
#1045 - thraizz / @AronSchueler

08/22/2020 at 12:15PM

17
#1046 - Hu Junfeng / @junfeng

08/22/2020 at 02:43PM

17
#1047 - Håvard Moe Jacobsen / @Mjheyjs

09/10/2020 at 01:17PM

17
#1048 - will / @willpnw

09/16/2020 at 03:04AM

17
#1049 - Ayush Singh / @Whoosh13

10/01/2020 at 11:51PM

17
#1050 - Júda Ronén / @JudaRonen

10/10/2020 at 07:26PM