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

0 comments


Created by: @NieDzejkob

86 active golfers, 322 entries

Leaderboard (lowest score wins):
12
#61 - BaffaloP πŸƒπŸŽ¨ / @bbaffalopp

09/09/2019 at 10:31PM

12
#62 - crazydon1 / @crazydon19

09/16/2019 at 11:14AM

13
#63 - I:Boss / @ibossptk

08/12/2019 at 01:14PM

13
#64 - Nicolas πŸ‘¨β€πŸ’»πŸ‡¨πŸ‡¦ / @martinni39

08/16/2019 at 02:09PM

13
#65 - Floyd Gantt / @fgantt

08/16/2019 at 07:28PM

13
#66 - Preetham Maiya / @PreethamMaiya

08/25/2019 at 03:28PM

13
#67 - γ˜γ‚“γΊγƒΌ / @jinpei0908

08/31/2019 at 01:21PM

13
#68 - Daniel Beck / @daniel_beck_il

09/10/2019 at 12:48PM

13
#69 - Iggy / @iggredible

09/11/2019 at 03:42AM

14
#70 - Kota Mori / @KotaMori1

08/13/2019 at 10:56PM

14
#71 - Zane / @Zane19489481

08/15/2019 at 03:08PM

15
#72 - Miki Tebeka / @tebeka

08/09/2019 at 05:31AM

15
#73 - Arnaud / @arnaudmm

08/17/2019 at 03:20PM

15
#74 - Phoon / @justflashhim

08/18/2019 at 08:10PM

15
#75 - vim_ninja / @NinjaVim

08/19/2019 at 02:48AM

15
#76 - Gunnar Thoreson / @ThReGgOn

09/05/2019 at 01:02PM

16
#77 - Derek Schrock / @derekschrock

08/09/2019 at 01:11AM

16
#78 - vimgolfuser123 / @vimgolfuser123

08/13/2019 at 03:20AM

16
#79 - Myki Myke / @myke_myki

08/13/2019 at 09:24AM

16
#80 - Milind Mantri / @MantriMilind

08/15/2019 at 07:46AM

16
#81 - Ariel Miculas / @ArielMiculas

09/18/2019 at 04:38PM

18
#82 - Luiz Eduardo Amaral / @_luxedo

08/13/2019 at 03:56PM

18
#83 - dahara / @kuma_moooon

08/15/2019 at 03:01PM

19
#84 - Paul Inc / @hiniol1982

08/14/2019 at 07:04PM

22
#85 - Cliff Chung / @CliffChung

08/16/2019 at 06:49PM

25
#86 - Alexander Dikelsky / @ADikelsky

08/14/2019 at 08:53PM