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):
10
#91 - Константин / @pillar_vandyke

10/18/2019 at 02:13AM

10
#92 - Lory / @Lory46845742

10/31/2019 at 02:50PM

10
#93 - trafficone / @trafficone

11/02/2019 at 06:25AM

10
#94 - Melvin Cheung / @MelvinCheung

11/08/2019 at 02:38AM

10
#95 - Roger Stoltz / @rogsto1

11/14/2019 at 10:45PM

10
#96 - Andrei Popescu / @AndreiTheory

12/09/2019 at 09:25PM

10
#97 - King Kang / @nobagtravel

12/12/2019 at 06:07PM

10
#98 - John Otters / @OttersJohn

12/17/2019 at 03:25AM

10
#99 - Jason Neylon / @jasonneylon

12/28/2019 at 11:13AM

10
#100 - Rune Warhuus / @DinkDonkNorway

01/23/2020 at 12:52PM

10
#101 - floyd / @floyd10086

03/11/2020 at 02:57AM

10
#102 - BESSENG A IREH Guy / @guybesseng

03/13/2020 at 04:54PM

10
#103 - BnnGolfer / @BnnGolfer

03/28/2020 at 02:48PM

10
#104 - RaylanFox / @RaylanFox

04/11/2020 at 06:48PM

10
#105 - volandkit / @volandkit

04/22/2020 at 06:56PM

10
#106 - Soumadeep Saha / @SoumadeepSaha8

05/10/2020 at 01:49AM

10
#107 - Robberechts Arne / @ArneRobberechts

06/14/2020 at 07:44PM

11
#108 - Ivo Blöchliger / @aigledesalpes

08/09/2019 at 05:22AM

11
#109 - André Reigoto / @AndreReigoto

08/09/2019 at 02:39PM

11
#110 - Gary NPC / @GaryNpc

08/10/2019 at 09:18AM

11
#111 - Fritz Inf / @6360info

08/10/2019 at 02:09PM

11
#112 - Brian Li / @BriungRi

08/12/2019 at 07:56PM

11
#113 - Diego Navarro / @die_4001

08/13/2019 at 05:47PM

11
#114 - Karan Gajwani / @karangb

08/16/2019 at 09:48AM

11
#115 - vicver09 / @vicver091

10/27/2019 at 02:27PM

11
#116 - shota_ogswr / @shota_ogasawara

11/26/2019 at 03:08PM

12
#117 - Vim Golfer / @VimGolfer6

08/09/2019 at 01:17PM

12
#118 - ʀǟɦʊʟ ɮɦօʟǟ / @theRahulBhola

08/15/2019 at 07:04PM

12
#119 - BaffaloP 🐃🎨 / @bbaffalopp

09/09/2019 at 10:31PM

12
#120 - crazydon1 / @crazydon19

09/16/2019 at 11:14AM