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):
22
#1261 - Andrei Popescu / @AndreiTheory

03/08/2020 at 10:27PM

22
#1262 - Michael Bennett Cohn / @miconian

03/11/2020 at 05:58AM

22
#1263 - finn.mertens / @finnmer22139082

03/13/2020 at 01:29AM

22
#1264 - Origier / @Origier2

03/23/2020 at 01:59AM

22
#1265 - Nelio Santos / @nssantos

03/25/2020 at 02:16AM

22
#1266 - Saransh Barua / @_saranshbarua

03/28/2020 at 05:53PM

22
#1267 - Christopher MCA / @christopherMCA

04/02/2020 at 02:03AM

22
#1268 - Vivek / @vks_O0O_

04/02/2020 at 10:01AM

22
#1269 - Silap Aliyev / @oaakx

04/04/2020 at 09:57AM

22
#1270 - Jason / @roosjason

04/05/2020 at 12:44AM

22
#1271 - Ralph Callaway / @RalphAtCCC

04/06/2020 at 10:55PM

22
#1272 - James Sinclair / @sreknis

04/10/2020 at 04:11PM

22
#1273 - ic / @ic35850646

04/25/2020 at 09:37PM

22
#1274 - Olcay Oransoy / @olcayrnsy

04/30/2020 at 08:09AM

22
#1275 - Sarayut Lawilai / @imkopkap

05/05/2020 at 05:41PM

22
#1276 - ATTIA Guillaume / @guillaume_attia

05/10/2020 at 12:43AM

22
#1277 - ол ов о / @2dTyjFurC1MKMvd

05/14/2020 at 09:00AM

22
#1278 - smile at humor / @pseuyi

05/14/2020 at 09:21PM

22
#1279 - Vallaa123 / @vallaa123

05/25/2020 at 07:07AM

22
#1280 - albert / @albert07971271

05/27/2020 at 05:34PM

22
#1281 - Dr. Bharat Bhushan Verma / @dearbharat1

05/31/2020 at 12:33AM

22
#1282 - Silverei / @silvereii

06/23/2020 at 06:31AM

22
#1283 - Josh Lindoo / @JoshLindoo

07/01/2020 at 04:26PM

22
#1284 - Patryk Jachowski / @programatryk

07/04/2020 at 06:32AM

22
#1285 - Anil Narayan / @AnilNarayan2013

07/09/2020 at 05:25AM

22
#1286 - ejay 🍅 / @ejaytomato

07/24/2020 at 03:04AM

22
#1287 - Hussein El-Sayed / @HusseinElSayed4

08/18/2020 at 10:06AM

22
#1288 - ETHEREUM_MINE_TAEMIN / @MineTaemin

08/21/2020 at 08:59AM

22
#1289 - hp / @tweetsbyhp77

09/12/2020 at 02:21PM

22
#1290 - vimgolfer12345 / @vimgolfer12345

09/16/2020 at 09:01AM