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

1434 active golfers, 5829 entries

Leaderboard (lowest score wins):
20
#1171 - Darren Brien / @darrenkbrien

05/12/2020 at 02:53PM

20
#1172 - 翼士六高达 / @9dTFbiwyHjPmSY9

05/13/2020 at 11:31AM

20
#1173 - She3o at HOME / @Anas_She3sha3y

05/18/2020 at 08:57AM

20
#1174 - Jean-Charles Quillet / @jc_jecaro

05/19/2020 at 02:58PM

20
#1175 - Wesley May / @wjomlex

05/22/2020 at 03:21AM

20
#1176 - bigsystem / @bigsystem2

05/28/2020 at 02:23PM

20
#1177 - El-Tabei / @eltabei_m

05/29/2020 at 09:22PM

20
#1178 - natasha / @CallMeNatchos

05/31/2020 at 09:51PM

20
#1179 - Cassio / @cassiobatista

06/03/2020 at 12:42AM

20
#1180 - Jules / @namebrandloser

06/11/2020 at 07:05PM

20
#1181 - Axel Yung / @axelyung

06/14/2020 at 11:25PM

20
#1182 - Isaac Pohl-Zaretsky / @IsaacPZZ

06/15/2020 at 04:56AM

20
#1183 - Mruczek / @mruczek1337

06/20/2020 at 12:27AM

20
#1184 - Di Liu / @Skyerliu

06/20/2020 at 06:56PM

20
#1185 - Temp / @San5nom

06/22/2020 at 07:31PM

20
#1186 - MrRubiksSC / @ScRubiks

06/25/2020 at 05:49AM

20
#1187 - tranmonglong / @tranmonglong

07/02/2020 at 07:35AM

20
#1188 - nihilistkitten / @nihilistkitten1

07/04/2020 at 02:42AM

20
#1189 - PoodleSkirt / @PoodleSkirt2

07/23/2020 at 08:25PM

20
#1190 - MathijsHoogland / @MathijsHoogland

07/26/2020 at 03:00PM

20
#1191 - James Blanton / @jamespblanton

07/29/2020 at 11:09PM

20
#1192 - Matthias / @Matthia78044730

08/03/2020 at 01:54PM

20
#1193 - Patrick Lavin / @LavinComputes

08/04/2020 at 12:38AM

20
#1194 - Chris Larkin / @Cupcakus

08/11/2020 at 10:09PM

20
#1195 - Muhsin AbdulMohammed / @muhsin____

08/16/2020 at 03:44PM

20
#1196 - Omer / @OT22142535

08/22/2020 at 05:46PM

20
#1197 - Lawrence Long / @lawrenceylong

08/23/2020 at 04:29PM

20
#1198 - Väinö Heijari / @HeijariVaino

08/24/2020 at 07:18PM

20
#1199 - Art / @Art80615229

08/31/2020 at 05:09PM

20
#1200 - victor devyatov / @DevyatovVictor

09/02/2020 at 06:00PM