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):
14
#811 - Julian Geiger / @JulianGeiger14

09/11/2020 at 10:03AM

14
#812 - Johan Arrhen / @JoPeArrhen

09/19/2020 at 10:27AM

14
#813 - Fransis / @fransisnk

09/23/2020 at 09:57PM

14
#814 - " / @bluugs

09/25/2020 at 06:28PM

14
#815 - Brendan Schaenzer / @bschaenzer

09/29/2020 at 07:11PM

14
#816 - Noah / @NoahRosenzweig

10/15/2020 at 03:03PM

14
#817 - Ramūnas Musteikis / @RamnasMusteiki1

10/17/2020 at 02:17PM

14
#818 - Izmoqwy / @Izmoqwy

10/21/2020 at 12:34PM

14
#819 - Travi$ / @scotlaflame

10/23/2020 at 01:06PM

14
#820 - miguel / @miguel33704096

10/23/2020 at 01:09PM

14
#821 - Rodrigo Santa Cruz / @rstcruzo

10/24/2020 at 06:59AM

14
#822 - MrRubiksSC / @RubiksSc

11/07/2020 at 11:00PM

14
#823 - Rickard Natt och Dag / @rnattochdag

11/12/2020 at 10:39AM

14
#824 - Yondonjamts Ganzorig / @yondonjamts_g

11/14/2020 at 09:22PM

14
#825 - James Lowenthal / @JamesAnthonyLow

12/19/2020 at 05:37PM

14
#826 - Mach / @back2mach

01/02/2021 at 03:25PM

14
#827 - knobbelkesvlaai / @knobbelkesvlaai

01/13/2021 at 10:27AM

14
#828 - tylertucker202 / @tylertucker202

01/18/2021 at 08:11PM

14
#829 - Moeen Ahmad Tahir / @moeentahir

01/18/2021 at 09:02PM

14
#830 - Ronen Lahat / @Ronenl

01/19/2021 at 02:27PM

14
#831 - Oleg / @Oleg36601324

01/28/2021 at 11:52AM

14
#832 - John Smith / @JohnSmi38307095

03/19/2021 at 01:55PM

14
#833 - ._. / @Katharsic

05/16/2021 at 10:39AM

15
#834 - Nihil / @Nihil3

02/21/2020 at 07:46PM

15
#835 - Alan Kessler / @alankesslr

02/22/2020 at 05:43AM

15
#836 - Chris League / @chrisleague

02/22/2020 at 09:08PM

15
#837 - Emil / @emilklindt

02/22/2020 at 11:10PM

15
#838 - Bennett / @bennettbackward

02/24/2020 at 04:01AM

15
#839 - out of cache / @outofcache

02/25/2020 at 12:31PM

15
#840 - かぎりん / @kagilinn

03/02/2020 at 01:14AM