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

0 comments


Created by: @NieDzejkob

137 active golfers, 538 entries

Leaderboard (lowest score wins):
10
#61 - Chester Yap / @Chest_ErYap

08/09/2019 at 02:37PM

10
#62 - Thomas Tøkje / @tokjenator

08/09/2019 at 02:43PM

10
#63 - Chris Shorrock / @EbinFlow

08/13/2019 at 04:11PM

10
#64 - Jonathan Eidsness / @jonathaneidsnes

08/14/2019 at 08:19PM

10
#65 - Adam Stephen / @2_71828

08/17/2019 at 07:05AM

10
#66 - Mr_Djez / @DjezMr

08/18/2019 at 08:22PM

10
#67 - ameebo / @meebwish546

08/20/2019 at 02:25PM

10
#68 - Stefan Krist / @nerdyness_sk

08/20/2019 at 02:44PM

10
#69 - kevinski / @kevinsk30746831

08/22/2019 at 05:12PM

10
#70 - Simon Wilkinson / @simondwilkinson

08/24/2019 at 03:18PM

10
#71 - sundeep routhu / @sundeep12005

08/29/2019 at 04:56PM

10
#72 - Christian / @paierlep

08/31/2019 at 08:36AM

10
#73 - Abner jr / @Abnerjr19

09/13/2019 at 11:47AM

10
#74 - Alexander L. / @Lexol4s

09/28/2019 at 10:42PM

10
#75 - Miko / @_m_ik_o_

09/30/2019 at 04:19PM

10
#76 - Homo Ludens / @BsMainly

10/17/2019 at 02:41PM

10
#77 - Константин / @pillar_vandyke

10/18/2019 at 02:13AM

10
#78 - Lory / @Lory46845742

10/31/2019 at 02:50PM

10
#79 - trafficone / @trafficone

11/02/2019 at 06:25AM

10
#80 - Melvin Cheung / @MelvinCheung

11/08/2019 at 02:38AM

10
#81 - Roger Stoltz / @rogsto1

11/14/2019 at 10:45PM

10
#82 - Andrei Popescu / @AndreiTheory

12/09/2019 at 09:25PM

10
#83 - King Kang / @nobagtravel

12/12/2019 at 06:07PM

10
#84 - John Otters / @OttersJohn

12/17/2019 at 03:25AM

10
#85 - Jason Neylon / @jasonneylon

12/28/2019 at 11:13AM

10
#86 - Rune Warhuus / @DinkDonkNorway

01/23/2020 at 12:52PM

11
#87 - Ivo Blöchliger / @aigledesalpes

08/09/2019 at 05:22AM

11
#88 - André Reigoto / @AndreReigoto

08/09/2019 at 02:39PM

11
#89 - Gary NPC / @GaryNpc

08/10/2019 at 09:18AM

11
#90 - Fritz Inf / @6360info

08/10/2019 at 02:09PM