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 5d4cb5ed5f97770009e52f52

Unsemantic linewrapping

[Inspired by a blog post I read: https://scott.mn/2014/02/21/semantic_linewrapping/. Text adapted.] Sometimes when editing a Markdown file, I wrap the lines semantically. Instead of inserting a newline at 70 columns (or whatever), or making paragraphs one long line, I put in newlines at a point that seems logical to me. This may seem silly, but it produces better diffs. Semantic linewrapping also makes editing snappier. I can delete, edit or insert sentences easily using linewise operations. Code-oriented text editors like Vim and [REDACTED] are really good at this kind of manipulation. Editing text that hasn't been wrapped semantically is a pain, though:

Start file
Here is a paragraph with some stuff in it. This is the second sentence. This
sentence is really long, and ugly, and the truth is that it basically says
nothing at all. This is the last sentence of the paragraph; thanks for reading!
End file
Here is a paragraph with some stuff in it. This is the second sentence. This is
the last sentence of the paragraph; thanks for reading!

View Diff

1,3c1,2
< Here is a paragraph with some stuff in it. This is the second sentence. This
< sentence is really long, and ugly, and the truth is that it basically says
< nothing at all. This is the last sentence of the paragraph; thanks for reading!
---
> Here is a paragraph with some stuff in it. This is the second sentence. This is
> the last sentence of the paragraph; thanks for reading!

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 158 remaining solutions by signing in and submitting your own entry
#159 Alexander Dikelsky / @ADikelsky - Score: 25 - 08/14/19 @ 20:53
A is<Esc>jdddt.<Esc>dtlithe <Esc>:wq<CR>

0 comments


Created by: @NieDzejkob

159 active golfers, 636 entries

Leaderboard (lowest score wins):
9
#31 - pommevilla / @pawlrus

09/03/2019 at 06:56PM

9
#32 - Baine Wedlock / @BaineWedlock

09/06/2019 at 10:26AM

9
#33 - Zach Ingbretsen / @ZIngbretsen

09/07/2019 at 03:22PM

9
#34 - lucca augusto / @LuccaAugusto6

09/08/2019 at 02:08PM

9
#35 - vimgolfer / @vimgolfer7

09/21/2019 at 02:32PM

9
#36 - Viktor Styrud / @ViktorStyrud

09/23/2019 at 08:55AM

9
#37 - brypto / @hiimbenjy

09/30/2019 at 10:15PM

9
#38 - Andrzej Wąsowski / @AndrzejWasowski

10/06/2019 at 09:27AM

9
#39 - Soptik / @Soptik3

10/10/2019 at 08:28PM

9
#40 - Sam O'Malley / @Samuel_OMalley

10/12/2019 at 03:49AM

9
#41 - kkscr / @kkscr1

10/13/2019 at 02:19PM

9
#42 - Mario Olofo / @mario_olofo

10/17/2019 at 04:36AM

9
#43 - Jonathan Medwig / @jmedwig

10/17/2019 at 02:38PM

9
#44 - Tamás Kárándi / @tkarandi

10/19/2019 at 05:56PM

9
#45 - Ivan Volosyuk / @IvanVolosyuk

10/21/2019 at 09:12AM

9
#46 - Jeremy Soller / @jeremy_soller

10/25/2019 at 01:16AM

9
#47 - harmony_krieg / @harmony_krieg

10/27/2019 at 10:12AM

9
#48 - Gregory Furter / @gfurter

10/27/2019 at 07:43PM

9
#49 - skamgolf / @skamgolf

11/08/2019 at 01:45AM

9
#50 - damien / @GreatTestyTest

11/13/2019 at 06:05AM

9
#51 - Daniel Klepacki / @daniel_klepacki

11/14/2019 at 06:04PM

9
#52 - mogitate / @mutemeat

11/16/2019 at 08:25AM

9
#53 - Matt Aschmann / @ma7hatter

11/26/2019 at 07:30PM

9
#54 - Dan Kilman / @dan_kilman

12/19/2019 at 07:26PM

9
#55 - Delon / @delonleonard

12/26/2019 at 01:48PM

9
#56 - Brent Westbrook / @westbrook_brent

01/22/2020 at 09:54PM

9
#57 - howanto / @ho_wan_

02/21/2020 at 11:28AM

9
#58 - countime / @countime1

03/09/2020 at 09:32AM

9
#59 - Sean Dewar / @seandewar

03/13/2020 at 10:08PM

9
#60 - Oleg / @colega

03/31/2020 at 05:24PM