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 [challenge ID]

Played Challenges

Easier Align - 257 entries

Align the columns of a markdown table

  • Best score: 57
  • Best player score: 339
  • Position: #67 / 81
  • Number of attempts: 1
Paste a column after a column - 2120 entries

This task is very common while using multi-cursor. What is the elegant vim way ?

  • Best score: 14
  • Best player score: 14
  • Position: #8 / 453
  • Number of attempts: 12
Tabbed Table to Python Array - 604 entries

Not payed by the hour? So make it fast ;-) The table contains the relative occurencies of bigrams (two consecutive letters) in 1/100,000 in the german language, copy-pasted from http://www.mathe.tu-freiberg.de/~hebisch/cafe/kryptographie/bigramme.html

  • Best score: 50
  • Best player score: 60
  • Position: #70 / 158
  • Number of attempts: 2
HS exam question - 1420 entries

Convert the data to a python dictionary

  • Best score: 47
  • Best player score: 48
  • Position: #30 / 382
  • Number of attempts: 14
Reformat symbols in list - 1417 entries

Saw this in some lecture, easy reformatting using multiple cursor in VS Code

  • Best score: 24
  • Best player score: 27
  • Position: #134 / 312
  • Number of attempts: 5
Changing around text with citations - 302 entries

Based off of something I saw on reddit

  • Best score: 28
  • Best player score: 43
  • Position: #59 / 85
  • Number of attempts: 3
Poorly indented Python comments - 1145 entries

Fix the alignment of some Python comments as quickly as possible.

  • Best score: 15
  • Best player score: 15
  • Position: #32 / 197
  • Number of attempts: 16
2 quick changes and a numbered list - 573 entries

The ascii will not be lost, but rather numbered in 4 digit blocks with leading zeros.

  • Best score: 37
  • Best player score: 58
  • Position: #96 / 138
  • Number of attempts: 2
delete swap - 1454 entries

delete all swap

  • Best score: 5
  • Best player score: 5
  • Position: #198 / 461
  • Number of attempts: 5
Generate a very basic Python constructor (fixed) - 1155 entries

Original by @BiddulphCaleb (http://www.vimgolf.com/challenges/6019f1c4642668000cee11e8) - had some extra spaces in output file.

  • Best score: 29
  • Best player score: 43
  • Position: #120 / 243
  • Number of attempts: 4
Visual block training - 949 entries

You see the input. You see the output. Go.

  • Best score: 17
  • Best player score: 18
  • Position: #31 / 174
  • Number of attempts: 13
Put a newline after every 10 lines in vim - 1550 entries

Goal is to put a newline after every 10 lines in vim.

  • Best score: 10
  • Best player score: 11
  • Position: #157 / 517
  • Number of attempts: 3
Wikitext headings to markdown - 946 entries

Convert the wikitext headings to markdown.

  • Best score: 20
  • Best player score: 31
  • Position: #136 / 197
  • Number of attempts: 1
hello-world-vimgolf - 2294 entries

Simple number generation

  • Best score: 10
  • Best player score: 10
  • Position: #252 / 648
  • Number of attempts: 4
Fill in the chess board - 886 entries

Fill in the name of each square using its file (a-h) and rank (1-8).

  • Best score: 19
  • Best player score: 25
  • Position: #59 / 173
  • Number of attempts: 9
Plotting some variables in python - 1539 entries

4 sets of (x,y) variables to plot. Just increment the numbers! Well, let's change the colors of the lines as well. Oh and we meant to plot the absolute values of course.

  • Best score: 34
  • Best player score: 56
  • Position: #228 / 327
  • Number of attempts: 2
Lowercase first characters - 455 entries

This is the (abridged) input for Day 3 in Advent of Code 2019. The output is a format more suitable for Prolog programming: the two lines of input become two lists of pairs, joined together in a wires functor.

  • Best score: 33
  • Best player score: 43
  • Position: #111 / 170
  • Number of attempts: 3
Python dataclasses - 972 entries

Simple challenge to extract fields from a Python class

  • Best score: 19
  • Best player score: 41
  • Position: #221 / 247
  • Number of attempts: 1
Modernise code - 1316 entries

Modernise and clean up some C++ code.

  • Best score: 34
  • Best player score: 48
  • Position: #207 / 304
  • Number of attempts: 1
HS Final exam vimgolf - 862 entries

Change the initial file to a single line containing all names comma-separated with numbers inside parentheses.

  • Best score: 21
  • Best player score: 21
  • Position: #33 / 225
  • Number of attempts: 8
Easy modification of ssh config - 335 entries

Just add another alias to each worker

  • Best score: 24
  • Best player score: 31
  • Position: #71 / 104
  • Number of attempts: 1
Satisfy the go linter - 2153 entries

You just came up with this briliant go vars package. But dang, you forgot to add comments to the exported variables. Can you add a comment over each variable with a TODO-placeholder?

  • Best score: 20
  • Best player score: 21
  • Position: #180 / 433
  • Number of attempts: 5
Add quotes to ansible playbook - 872 entries

You created an ansible playbook, but forgot to add quotes. Can you fix it?

  • Best score: 8
  • Best player score: 9
  • Position: #186 / 274
  • Number of attempts: 4
Multiline to Single Line - 596 entries

Convert a multiline, indented file to a single line with no whitespace

  • Best score: 5
  • Best player score: 5
  • Position: #216 / 268
  • Number of attempts: 7
xrandr outputs and dashes - 652 entries

uh oh, different video drivers identify display outputs with more dashes. Quick, need to change this xrandr script!

  • Best score: 12
  • Best player score: 18
  • Position: #191 / 213
  • Number of attempts: 3
Unsemantic linewrapping - 890 entries

[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:

  • Best score: 9
  • Best player score: 9
  • Position: #99 / 224
  • Number of attempts: 8
Applying same text modification in several lines - 2845 entries

Remove identical text at the beginning of several lines and the closing parenthesis.

  • Best score: 12
  • Best player score: 12
  • Position: #20 / 840
  • Number of attempts: 5
Add string initializers to an enum - 862 entries

Change Typescript enum so that it has string initializers.

  • Best score: 21
  • Best player score: 23
  • Position: #120 / 254
  • Number of attempts: 5
Bad Copy Syntax - 1999 entries

Copy should be from right to left, but sometimes you type it wrong.

  • Best score: 18
  • Best player score: 19
  • Position: #214 / 514
  • Number of attempts: 4
Extract wireshark capture filter - 198 entries

Extract wireshark capture filter from IP plan

  • Best score: 25
  • Best player score: 29
  • Position: #44 / 67
  • Number of attempts: 2
Extract HTML option values from tag values - 98 entries

Generate HTML option values from the text in the option tag. If the text contains multiple words, replace the spaces with an underscore and convert all capital letters to small letters.

  • Best score: 34
  • Best player score: 37
  • Position: #21 / 42
  • Number of attempts: 4
Turn a ninja to case-insensitive [Nn][Ii][Nn][Jj][Aa] regexp! - 63 entries

I bumped into this in a dailywtf code: http://pastebin.com/QApa5ycS I didn't want to translate a string whenever I wanted to be [Ss][Aa][Rr][Cc][Aa][Ss][Tt][Ii][Cc] on slack, so I figured a script (python, sed, whatever) would be helpful. Well, or a few vim keystroke!

  • Best score: 18
  • Best player score: 20
  • Position: #37 / 37
  • Number of attempts: 2
Fiddle percentages into real numbers - 840 entries

Get rid of the '%' symbols and shift the decimal place. This is the easier version - all the columns line up.

  • Best score: 13
  • Best player score: 13
  • Position: #159 / 287
  • Number of attempts: 5
Combines all items - 303 entries

For each line that starts with the same number I want to combine its contents

  • Best score: 9
  • Best player score: 10
  • Position: #127 / 137
  • Number of attempts: 2
change parenthesis - 278 entries

change the pair of braces into a pair of parentheses

  • Best score: 9
  • Best player score: 10
  • Position: #143 / 156
  • Number of attempts: 1
e_e
Twitter:

El diplomático es una persona que primero piensa dos veces y finalmente no dice nada. (W.Churchill)

entered into 35 challenges

contributed 0 challenges