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

1174 active golfers, 4856 entries

Leaderboard (lowest score wins):
10
#61 - Peter Tran / @Fulton_Jewelry

03/21/2020 at 12:07AM

10
#62 - Kelvin Chaves / @_kelvincs

03/21/2020 at 12:58PM

10
#63 - Marco / @Marco24456514

03/21/2020 at 07:33PM

10
#64 - Yan Xue / @_yxue

03/21/2020 at 09:29PM

10
#65 - coleyh / @hcoleyh

03/22/2020 at 02:33AM

10
#66 - Howl / @Howlxx55

03/22/2020 at 01:44PM

10
#67 - Robberechts Arne / @ArneRobberechts

03/22/2020 at 02:30PM

10
#68 - nicosierra / @nicosierra84

03/22/2020 at 07:17PM

10
#69 - Nick Buser / @buser_nick

03/23/2020 at 12:30AM

10
#70 - Romeo Valentin / @Seecez

03/23/2020 at 12:53PM

10
#71 - Max Edwards / @maxwedwards

03/23/2020 at 08:32PM

10
#72 - zaid emad / @zaid_emad97

03/25/2020 at 10:08AM

10
#73 - Calvin Janitra Halim / @CalvinJH

03/25/2020 at 05:46PM

10
#74 - Namn / @Namn59676557

03/25/2020 at 09:13PM

10
#75 - Maxim / @Maxim_at_Moscow

03/26/2020 at 05:11PM

10
#76 - koyumeishi / @koyumeishi_

03/27/2020 at 07:54PM

10
#77 - Patrick Baxter / @ZenAether

03/28/2020 at 01:27AM

10
#78 - Jan / @Howi48

03/28/2020 at 12:23PM

10
#79 - Frank Harrison / @doublethefish

03/29/2020 at 02:35PM

10
#80 - Kyle X. Clark / @KyXr_Clark

03/29/2020 at 06:41PM

10
#81 - Mats Faugli / @matsfaugli

03/29/2020 at 08:48PM

10
#82 - Vaibhav Kaushik / @vnzongzna

03/30/2020 at 07:35PM

10
#83 - Jesse Test / @JesseTest15

03/30/2020 at 08:54PM

10
#84 - Brett Castellanos / @bcas1984

04/02/2020 at 04:51PM

10
#85 - Harri Taylor / @_harritaylor

04/04/2020 at 12:23AM

10
#86 - Вова Соколович / @vovasokoll

04/04/2020 at 03:43AM

10
#87 - mury liang / @muryliang

04/04/2020 at 05:48AM

10
#88 - Daniel Fleischman / @vimgolfdaniel

04/05/2020 at 08:14PM

10
#89 - Andy Balaam / @andybalaam

04/07/2020 at 01:40PM

10
#90 - Skywalker 666 / @MemeMasterXXI

04/09/2020 at 07:26AM