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

0 comments


Created by: @NieDzejkob

160 active golfers, 652 entries

Leaderboard (lowest score wins):
9
#61 - Rodrigo V. Lopes / @rodvlopes

04/10/2020 at 08:20PM

9
#62 - Moatvald / @moatvald

04/18/2020 at 07:00AM

9
#63 - edvrds / @edvrds

04/18/2020 at 08:00PM

9
#64 - Jason / @roosjason

04/18/2020 at 11:13PM

9
#65 - Arthur Goodman / @ArthurGoodman3

05/01/2020 at 11:22AM

9
#66 - Mack Hutsell / @sellshuts

05/25/2020 at 12:46AM

9
#67 - 于吉星 / @fishermryn

05/28/2020 at 06:15AM

9
#68 - RockerZZY / @rocker_zzy

05/28/2020 at 11:57PM

9
#69 - Kevin Keefe / @KevinKeefe5

06/04/2020 at 12:35AM

9
#70 - せいほう / @FICSQF

06/06/2020 at 11:45AM

9
#71 - Valdimar / @genkobar

06/07/2020 at 08:49PM

9
#72 - majo senf / @majo_senf

07/14/2020 at 09:12AM

10
#73 - Valacar / @valacar

08/09/2019 at 04:58AM

10
#74 - John / @JohnJDoe2

08/09/2019 at 06:51AM

10
#75 - Jan Bundesmann / @janbundesmann

08/09/2019 at 07:08AM

10
#76 - Chester Yap / @Chest_ErYap

08/09/2019 at 02:37PM

10
#77 - Thomas Tøkje / @tokjenator

08/09/2019 at 02:43PM

10
#78 - Chris Shorrock / @EbinFlow

08/13/2019 at 04:11PM

10
#79 - Jonathan Eidsness / @jonathaneidsnes

08/14/2019 at 08:19PM

10
#80 - Adam Stephen / @2_71828

08/17/2019 at 07:05AM

10
#81 - Mr_Djez / @DjezMr

08/18/2019 at 08:22PM

10
#82 - ameebo / @meebwish546

08/20/2019 at 02:25PM

10
#83 - Stefan Krist / @nerdyness_sk

08/20/2019 at 02:44PM

10
#84 - kevinski / @kevinsk30746831

08/22/2019 at 05:12PM

10
#85 - Simon Wilkinson / @simondwilkinson

08/24/2019 at 03:18PM

10
#86 - sundeep routhu / @sundeep12005

08/29/2019 at 04:56PM

10
#87 - Christian / @paierlep

08/31/2019 at 08:36AM

10
#88 - Abner jr / @Abnerjr19

09/13/2019 at 11:47AM

10
#89 - Alexander L. / @Lexol4s

09/28/2019 at 10:42PM

10
#90 - Miko / @_m_ik_o_

09/30/2019 at 04:19PM