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

0 comments

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

0 comments

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

0 comments

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

0 comments

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

0 comments

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

0 comments

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

0 comments

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

0 comments

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

0 comments

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

0 comments

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

0 comments

Created by: @udioica

51 active golfers, 102 entries

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

11/21/2012 at 01:32PM

16
#2 - Urtica dioica / @udioica

11/21/2012 at 01:44PM

16
#3 - Marcin Sza / @coot_

11/22/2012 at 02:58AM

16
#4 - Kerson Hsiao / @KersonHsiao

11/22/2012 at 04:04AM

16
#5 - Conner McDaniel / @connermcd

11/22/2012 at 07:57AM

16
#6 - Pete Johns / @johnsyweb

11/22/2012 at 06:40PM

16
#7 - Danilo / @dbrgn

11/23/2012 at 01:37AM

16
#8 - a24f0600 / @a24f0600

11/23/2012 at 06:18AM

16
#9 - David Barnett / @mu_mind

11/23/2012 at 01:46PM

16
#10 - František Hartman / @frant_hartm

12/06/2012 at 12:21PM

16
#11 - Hubba / @HubbaBubbaFett

12/09/2012 at 11:43AM

16
#12 - cdan / @cdan

01/09/2013 at 02:46PM

16
#13 - Christopher Harrison / @Xophmeister

01/29/2013 at 07:07AM

16
#14 - Trevor Powell / @DoomedBunnies

03/19/2013 at 11:21PM

16
#15 - Gtranbot / @gtranbot

04/27/2013 at 02:52AM

16
#16 - Marco Hinz / @_mhinz_

05/26/2013 at 03:39AM

16
#17 - Nick S / @MaxxMeridius

08/23/2013 at 05:57PM

16
#18 - James / @Dronak

09/02/2013 at 07:49PM

16
#19 - Steven Mueller / @Gervigok

10/06/2013 at 01:08PM

16
#20 - Raphael / @rnstlr

11/26/2013 at 03:23PM

16
#21 - Pandu / @pandu_golf

01/05/2014 at 02:29AM

16
#22 - John Braxler / @braxler

06/13/2014 at 08:16AM

17
#23 - Enric / @VonKiike

12/13/2012 at 10:35AM

19
#24 - Allan Espinosa / @AllanEspinosa

11/23/2012 at 04:30AM

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

12/19/2012 at 12:21PM

23
#26 - Alec Goebel / @zego5360

01/04/2013 at 09:46AM

24
#27 - Vasil Sakarov / @vsakarov

11/21/2012 at 02:39PM

24
#28 - Pawel Obrok / @mrYapee

11/23/2012 at 11:49AM

24
#29 - Jamie / @jamiebikies

11/23/2012 at 02:35PM

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

11/25/2012 at 02:31AM

24
#31 - Alex Hammel / @AlexJHammel

12/24/2012 at 06:26AM

24
#32 - Lari / @larifariman

04/17/2013 at 02:47PM

24
#33 - zlydem / @zlydem

07/03/2013 at 02:49AM

24
#34 - Tullio Facchinetti / @toolleeo

07/25/2013 at 02:01PM

24
#35 - cj / @cj01101

10/19/2013 at 11:34AM

24
#36 - Joonas Pihlajamaa / @jokkebk

03/18/2014 at 01:04AM

25
#37 - Lieven Keersmaekers / @LievenKeersmaek

11/23/2012 at 12:13PM

25
#38 - XGOLFER / @vimg0lfer

01/04/2013 at 03:13PM

26
#39 - Jason Wolf / @zephyr_wolf

11/21/2012 at 12:43PM

26
#40 - Aniket Schneider / @shaydwyrm

11/23/2012 at 10:08PM

26
#41 - Armin / @twistedcommons

02/10/2013 at 07:17PM

26
#42 - N / @nymph192

02/24/2013 at 06:06PM

26
#43 - Chase Stubblefield / @sterlingchase

04/29/2013 at 09:12PM

26
#44 - Franck / @_frp

03/06/2014 at 03:02AM

27
#45 - n0nick / @n0nick

12/17/2012 at 08:37AM

28
#46 - Oh fear / @ohfear_num

11/28/2012 at 09:31PM

29
#47 - mhb / @mhbvim

11/23/2012 at 01:21AM

29
#48 - brett / @brettyukich

10/01/2013 at 02:36AM

31
#49 - Patrick Mosby / @halbtuerke

11/21/2012 at 09:21PM

33
#50 - Rob Glew / @RealGlew

06/13/2014 at 07:52AM

36
#51 - Ravi S Sinha / @ambidextrousTx

11/21/2012 at 07:48PM