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):
11
#631 - Free Man / @FreeMan16396552

10/21/2020 at 03:23AM

11
#632 - chocolate / @chocola81394123

10/23/2020 at 04:17AM

11
#633 - Jason Wang / @Jaded_Jason

10/23/2020 at 04:58AM

11
#634 - Em Dee / @VIMXPERT

10/23/2020 at 01:17PM

11
#635 - MySelf / @okmslf

10/24/2020 at 06:44AM

11
#636 - Arthur Aslanyan / @arthuraslanyan

10/29/2020 at 04:07AM

11
#637 - dahan / @dahan74265266

10/30/2020 at 06:22AM

11
#638 - Ossian O'Reilly / @ossian_oreilly

10/31/2020 at 09:36PM

11
#639 - Daedren / @Daedren

11/04/2020 at 10:28AM

11
#640 - Jakub / @vr0m

11/04/2020 at 03:30PM

11
#641 - Prabhat Ranjan / @prabhatr27

11/05/2020 at 06:20AM

11
#642 - Drahflow is Testing / @Drahflow_Test

11/05/2020 at 10:58PM

11
#643 - FrolPaderin / @FPaderin

11/07/2020 at 12:45PM

11
#644 - Jake Grossman / @PiranaLaugh

11/11/2020 at 05:30PM

11
#645 - Bruce Woodward / @b00ffer

11/11/2020 at 09:10PM

11
#646 - Jan Lukány / @Lukanyj

11/17/2020 at 03:27PM

11
#647 - hepebexè / @hepebexe

11/23/2020 at 08:33PM

11
#648 - why.degree / @WhyDegree

11/24/2020 at 12:37PM

11
#649 - __VimGolfer__ / @VimGolfer19

11/29/2020 at 06:52PM

11
#650 - Alex Watson / @AlexDewiWatson

12/01/2020 at 02:34PM

11
#651 - Jonathan Ketner / @Chariotrunner

12/03/2020 at 02:51AM

11
#652 - roudens / @roudens2

12/04/2020 at 04:22AM

11
#653 - akabaka / @akabakass

12/04/2020 at 04:03PM

11
#654 - 正気・腕力・不労所得 / @tsukimizake774

12/18/2020 at 09:13AM

11
#655 - John Doe / @JohnDoe75830353

12/19/2020 at 12:55PM

11
#656 - Camden Cheek / @ccheek21

12/20/2020 at 04:02AM

11
#657 - Yotsuba / @Yotsuba06764225

12/22/2020 at 03:52AM

11
#658 - Ray Dennis / @raysden

12/22/2020 at 11:54PM

11
#659 - dummy acc / @__dummy_acc

12/24/2020 at 10:15PM

11
#660 - Cybersepro / @Gealber2

12/25/2020 at 10:26AM