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):
15
#841 - Steffen / @Pions90

03/03/2020 at 09:27AM

15
#842 - Zander / @zanderk

03/08/2020 at 01:48PM

15
#843 - Vetle Neumann / @NeumannVetle

03/13/2020 at 02:29PM

15
#844 - 薛浩滎 / @iTPChbTeI4ZW9s3

03/15/2020 at 01:06AM

15
#845 - Rupesh / @Rupesh92076946

03/16/2020 at 09:20PM

15
#846 - Sergio Semedi / @SergioSemedi

03/18/2020 at 05:07PM

15
#847 - uuganbold tsegmed / @uuganbold

03/20/2020 at 04:22AM

15
#848 - etherflow / @etherfl0w

03/29/2020 at 05:03PM

15
#849 - Nick Lee / @TooManyNickLees

04/04/2020 at 03:28PM

15
#850 - Poigal Nitish / @poigalnitish

04/05/2020 at 08:54AM

15
#851 - NGageMegaman / @NGageMegaman

04/07/2020 at 09:11PM

15
#852 - 廖彥智 / @JeffYenchih

04/15/2020 at 09:35AM

15
#853 - Zachary Lee / @abstractlyZach

04/15/2020 at 05:54PM

15
#854 - まつーら / @uikbl

04/18/2020 at 11:08AM

15
#855 - zesk06 / @zesk06

04/19/2020 at 06:10AM

15
#856 - Gurukandhamoorthi / @Gurukandhamoor1

04/22/2020 at 06:23AM

15
#857 - Sai Hemanth / @saihemanth9019

04/24/2020 at 12:25PM

15
#858 - kindJeff / @sljeff_

04/26/2020 at 10:23AM

15
#859 - Юмор для всех / @humour_for_all

04/29/2020 at 04:04PM

15
#860 - Tzero Ocne / @TzeroOcne

05/08/2020 at 10:10AM

15
#861 - gorbitgames / @gorbitgames

05/10/2020 at 04:57PM

15
#862 - mattbillenstein / @mattbillenstein

05/13/2020 at 01:07AM

15
#863 - Lucas_Elsen / @DuVrangrGata18

05/16/2020 at 08:07AM

15
#864 - Jérémy Caldas / @jeremcs

05/16/2020 at 09:49AM

15
#865 - Chinmay Chhajed / @chhajedji

05/18/2020 at 10:35AM

15
#866 - Nicholas Boyd Isacsson / @nichobi

05/22/2020 at 11:01AM

15
#867 - Tapan Karnik / @TKarnik

05/22/2020 at 05:37PM

15
#868 - Felix Fritz / @geigenmusikant

05/25/2020 at 07:21PM

15
#869 - Israr Khan / @isrark

05/31/2020 at 09:00PM

15
#870 - Atiqur Rahman / @_atiqurrahman

05/31/2020 at 11:47PM