Real Vim ninjas count every keystroke - do you?

Pick a challenge, fire up Vim, and show us what you got.

Leaderboard, Changelog, Rules & FAQ, updates: @vimgolf, RSS.

Your VimGolf key: please sign in

$ gem install vimgolf
$ vimgolf setup
$ vimgolf put 50ad2cb165b8db0002000029

Unwrap the text of an email message

Reverse of "Wrap the text of an email message to 79 characters". gq and gw are great for wrapping paragraphs. But sometimes other programs choke on your wrapped lines. What's the best way to un-gq?

Start file
> "Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium
> doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore
> veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim
> ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

> Sed quia consequuntur magni dolores eos qui ratione voluptatem sequi
> nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet,
> consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt
> ut labore et dolore magnam aliquam quaerat voluptatem.

Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit
laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure
reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur,
vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?"
End file
> "Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

> Sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem.

Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?"

View Diff

1,4c1
< > "Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium
< > doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore
< > veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim
< > ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit.
---
> > "Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit.
6,8c3
< Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
< incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
< nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
---
> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
10,13c5
< > Sed quia consequuntur magni dolores eos qui ratione voluptatem sequi
< > nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet,
< > consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt
< > ut labore et dolore magnam aliquam quaerat voluptatem.
---
> > Sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem.
15,18c7
< Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit
< laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure
< reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur,
< vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?"
---
> Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?"

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 42 remaining solutions by signing in and submitting your own entry
#43 Armin / @twistedcommons - Score: 26 - 02/11/13 @ 03:17
4J2j3J2j4J2j4J:%s/ >//g|x<CR>

0 comments

#44 N / @nymph192 - Score: 26 - 02/25/13 @ 02:06
4J2j3J2j4J2j4J:%s/ >//g<CR>ZZ

0 comments

#45 Chase Stubblefield / @sterlingchase - Score: 26 - 04/30/13 @ 04:12
4J2j3J2j4J2j4J:%s/ >//g<CR>ZZ

0 comments

#46 Franck / @_frp - Score: 26 - 03/06/14 @ 11:02
4J}j3J)j4J)j4J:%s/ >//g<CR>ZZ

0 comments

#47 n0nick / @n0nick - Score: 27 - 12/17/12 @ 16:37
qqj<C-V>ljjdk4Jqjj3Jjj0@qjj4JZZ

0 comments

#48 Oh fear / @ohfear_num - Score: 28 - 11/29/12 @ 05:31
qq4J:s/ >//g<CR>qjj3Jjj@qjj4JZZ

0 comments

#49 mhb / @mhbvim - Score: 29 - 11/23/12 @ 09:21
qqvipJ2jq@q@@@@:%s/ > / /g<CR>ZZ

0 comments

#50 brett / @brettyukich - Score: 29 - 10/01/13 @ 09:36
}o<Esc>}.}.:v/^$/-j|%s/ > / /g<CR>ZZ

0 comments

#51 Patrick Mosby / @halbtuerke - Score: 31 - 11/22/12 @ 05:21
j<C-V>jjxkJJJ2jJJ3j0<C-V>jjxkJJJ2jJJJZZ

0 comments

#52 Rob Glew / @RealGlew - Score: 33 - 06/13/14 @ 14:52
qqA<Del><Del><Esc>q2@qjjqwA<Del> <Esc>q@w5G3@q7G3@wZZ

0 comments

#53 Ravi S Sinha / @ambidextrousTx - Score: 36 - 11/22/12 @ 03:48
j2xj.j.11G.j.j.vipJjj.6G.i<CR><Esc>ggvipJZZ

0 comments

Created by: @udioica

53 active golfers, 105 entries

Leaderboard (lowest score wins):
16
#1 - Tim Chase / @gumnos

11/21/2012 at 09:32PM

16
#2 - Urtica dioica / @udioica

11/21/2012 at 09:44PM

16
#3 - Marcin Sza / @coot_

11/22/2012 at 10:58AM

16
#4 - Kerson Hsiao / @KersonHsiao

11/22/2012 at 12:04PM

16
#5 - Conner McDaniel / @connermcd

11/22/2012 at 03:57PM

16
#6 - Pete Johns / @johnsyweb

11/23/2012 at 02:40AM

16
#7 - Danilo / @dbrgn

11/23/2012 at 09:37AM

16
#8 - a24f0600 / @a24f0600

11/23/2012 at 02:18PM

16
#9 - David Barnett / @mu_mind

11/23/2012 at 09:46PM

16
#10 - František Hartman / @frant_hartm

12/06/2012 at 08:21PM

16
#11 - Hubba / @HubbaBubbaFett

12/09/2012 at 07:43PM

16
#12 - cdan / @cdan

01/09/2013 at 10:46PM

16
#13 - Christopher Harrison / @Xophmeister

01/29/2013 at 03:07PM

16
#14 - Trevor Powell / @DoomedBunnies

03/20/2013 at 06:21AM

16
#15 - Gtranbot / @gtranbot

04/27/2013 at 09:52AM

16
#16 - Marco Hinz / @_mhinz_

05/26/2013 at 10:39AM

16
#17 - Nick S / @MaxxMeridius

08/24/2013 at 12:57AM

16
#18 - James / @Dronak

09/03/2013 at 02:49AM

16
#19 - Steven Mueller / @Gervigok

10/06/2013 at 08:08PM

16
#20 - Raphael / @rnstlr

11/26/2013 at 11:23PM

16
#21 - Pandu / @pandu_golf

01/05/2014 at 10:29AM

16
#22 - John Braxler / @braxler

06/13/2014 at 03:16PM

16
#23 - pftb12345 / @pftb12345

04/22/2015 at 06:01AM

16
#24 - Sprinkles / @sprinkles418

08/03/2015 at 03:38PM

17
#25 - Enric / @VonKiike

12/13/2012 at 06:35PM

19
#26 - Allan Espinosa / @AllanEspinosa

11/23/2012 at 12:30PM

23
#27 - Édouard M'tou / @DouardM

12/19/2012 at 08:21PM

23
#28 - Alec Goebel / @zego5360

01/04/2013 at 05:46PM

24
#29 - Vasil Sakarov / @vsakarov

11/21/2012 at 10:39PM

24
#30 - Pawel Obrok / @mrYapee

11/23/2012 at 07:49PM

24
#31 - Jamie / @jamiebikies

11/23/2012 at 10:35PM

24
#32 - 無ん垢の叫び / @john_ababa

11/25/2012 at 10:31AM

24
#33 - Alex Hammel / @AlexJHammel

12/24/2012 at 02:26PM

24
#34 - Lari / @larifariman

04/17/2013 at 09:47PM

24
#35 - zlydem / @zlydem

07/03/2013 at 09:49AM

24
#36 - Tullio Facchinetti / @toolleeo

07/25/2013 at 09:01PM

24
#37 - cj / @cj01101

10/19/2013 at 06:34PM

24
#38 - Joonas Pihlajamaa / @jokkebk

03/18/2014 at 08:04AM

25
#39 - Lieven Keersmaekers / @LievenKeersmaek

11/23/2012 at 08:13PM

25
#40 - XGOLFER / @vimg0lfer

01/04/2013 at 11:13PM

26
#41 - Jason Wolf / @zephyr_wolf

11/21/2012 at 08:43PM

26
#42 - Aniket Schneider / @shaydwyrm

11/24/2012 at 06:08AM

26
#43 - Armin / @twistedcommons

02/11/2013 at 03:17AM

26
#44 - N / @nymph192

02/25/2013 at 02:06AM

26
#45 - Chase Stubblefield / @sterlingchase

04/30/2013 at 04:12AM

26
#46 - Franck / @_frp

03/06/2014 at 11:02AM

27
#47 - n0nick / @n0nick

12/17/2012 at 04:37PM

28
#48 - Oh fear / @ohfear_num

11/29/2012 at 05:31AM

29
#49 - mhb / @mhbvim

11/23/2012 at 09:21AM

29
#50 - brett / @brettyukich

10/01/2013 at 09:36AM

31
#51 - Patrick Mosby / @halbtuerke

11/22/2012 at 05:21AM

33
#52 - Rob Glew / @RealGlew

06/13/2014 at 02:52PM

36
#53 - Ravi S Sinha / @ambidextrousTx

11/22/2012 at 03:48AM