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):
25
#1351 - fang. / @dfangshuo

05/31/2020 at 07:13PM

25
#1352 - tvanderwalt / @tvanderwalt4

06/15/2020 at 05:55AM

25
#1353 - Jamie Maddock / @jmasaki24

07/01/2020 at 08:27PM

25
#1354 - Jeff Nuss / @nussj

07/15/2020 at 04:06PM

25
#1355 - Dane / @studdugie

07/27/2020 at 06:45PM

25
#1356 - Kenny Nguyen / @KennyNg72375669

08/05/2020 at 09:31AM

25
#1357 - Christ / @Christ46234422

09/05/2020 at 06:46AM

25
#1358 - regito / @regito10

09/07/2020 at 03:56AM

25
#1359 - MoreWillMusic / @morewillmusic

09/30/2020 at 03:42PM

25
#1360 - wanghe / @2016wanghe

11/02/2020 at 02:19AM

25
#1361 - ever0de / @ever0de

05/26/2021 at 12:03PM

26
#1362 - ろーし / @WON13ROUSHI

02/29/2020 at 05:56AM

26
#1363 - Tran Kien Quoc / @legendtk84

03/20/2020 at 02:53PM

26
#1364 - gabbo ibatto / @gabboIbatto

04/14/2020 at 12:50AM

26
#1365 - Julian / @JulianBerton

05/25/2020 at 07:36AM

26
#1366 - Sameer K Hassan / @SameerKHassan1

10/01/2020 at 11:48PM

26
#1367 - Ermias Habtegabr / @EHabtegabr

12/26/2020 at 12:11AM

27
#1368 - れおくん / @awsiitchs

03/23/2020 at 03:28PM

27
#1369 - Michael Rogers / @mrog40

04/04/2020 at 04:45AM

27
#1370 - s4i / @Raven_rtb

05/31/2020 at 02:44PM

27
#1371 - Alessandro Tegner / @alesshh

06/16/2020 at 09:25PM

27
#1372 - abhijeet patil / @abhijeetptl5

09/02/2020 at 04:30PM

27
#1373 - dvorak4tzx / @dvorak4tzx4

12/28/2020 at 04:40PM

27
#1374 - projectDx / @Noritor

01/26/2021 at 12:00PM

27
#1375 - SwordSwordSwordBird / @SwordSwordBird

02/21/2021 at 06:47AM

28
#1376 - Alex / @heliophobicdude

04/16/2020 at 09:17PM

28
#1377 - scott mysliwy / @scott_mysliwy

06/02/2020 at 07:22AM

28
#1378 - Vincent Alegrete / @valegrete

06/12/2020 at 12:18AM

28
#1379 - Анастасия / @BQQ4X7tQt1xvHKf

07/13/2020 at 04:19PM

28
#1380 - amadej.likes.pizza@gmail.com / @AmadejLikes

08/07/2020 at 04:05AM