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

912 active golfers, 3827 entries

Leaderboard (lowest score wins):
10
#151 - 王有铭 / @wangyouming1209

05/22/2020 at 08:18AM

10
#152 - azad amitoz / @AzadAmitoz

05/22/2020 at 01:45PM

10
#153 - Adam Stephen / @2_71828

05/22/2020 at 05:42PM

10
#154 - Sheng Xi / @shenghsi

05/23/2020 at 06:14AM

10
#155 - Commence Corporation / @CommenceCorp

05/23/2020 at 12:09PM

10
#156 - Finlay l͓̽o͓̽c͓̽k͓̽e͓̽d͓̽d͓̽o͓̽w͓̽n͓̽ McAfee / @finsqm

05/23/2020 at 01:49PM

10
#157 - Chibi / @Chib49

05/23/2020 at 07:03PM

10
#158 - Dirty Harry / @TateDirty

05/23/2020 at 08:24PM

10
#159 - Andy / @ayy_ess_

05/23/2020 at 10:18PM

10
#160 - Kai.Li / @KaiLi19

05/24/2020 at 10:48AM

10
#161 - madfrog54321 / @madfrog54321

05/26/2020 at 09:23PM

10
#162 - superthot / @supercristo1

05/26/2020 at 10:20PM

10
#163 - RockerZZY / @rocker_zzy

05/27/2020 at 03:19AM

10
#164 - Aidan Wilson / @aidanbwilson

05/28/2020 at 01:48PM

10
#165 - Ryan McNamara / @MadDogMcNamara

05/28/2020 at 04:49PM

10
#166 - Matt DB / @MattDB12

05/28/2020 at 07:38PM

10
#167 - Julius / @cShortForC

05/29/2020 at 04:33PM

10
#168 - speisz / @speiszc

05/29/2020 at 10:28PM

10
#169 - nbspAD / @AdNbsp

05/31/2020 at 06:16AM

10
#170 - Edgar Domingues / @edgar_domingues

05/31/2020 at 10:43AM

10
#171 - Lili Boi / @lili_boi

05/31/2020 at 06:59PM

10
#172 - Ксения / @Xvluk

06/01/2020 at 08:48AM

10
#173 - Amit Kumar / @amit_locham

06/01/2020 at 03:51PM

10
#174 - Bob Streams / @BobStreams1

06/01/2020 at 06:44PM

10
#175 - Alek Mugnozzo / @mugnozzo

06/02/2020 at 06:21AM

10
#176 - Valdimar / @genkobar

06/02/2020 at 09:26PM

10
#177 - floyd / @floyd10086

06/03/2020 at 08:43AM

10
#178 - JamesT / @jamestrinklein

06/03/2020 at 08:18PM

10
#179 - Kien Nguyen Dinh / @kevinnguyen0125

06/04/2020 at 04:29AM

10
#180 - betmaster / @betmstr

06/04/2020 at 11:08PM