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):
17
#151 - Bitt Faulk / @bittfaulk

02/20/2020 at 09:27PM

18
#152 - Luiz Eduardo Amaral / @_luxedo

08/13/2019 at 03:56PM

18
#153 - dahara / @kuma_moooon

08/15/2019 at 03:01PM

19
#154 - Paul Inc / @hiniol1982

08/14/2019 at 07:04PM

20
#155 - Aaron / @_Lordofthevoid_

11/22/2019 at 03:03PM

21
#156 - Max Williams / @notmaxbutmax

10/15/2019 at 11:45PM

22
#157 - Cliff Chung / @CliffChung

08/16/2019 at 06:49PM

23
#158 - leo / @leo28356948

10/17/2019 at 11:59AM

25
#159 - Alexander Dikelsky / @ADikelsky

08/14/2019 at 08:53PM