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 - 344 entries

Align the columns of a markdown table

  • Best score: 51
  • Best player score: 339
  • Position: #74 / 89
  • Number of attempts: 1
Paste a column after a column - 2243 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 / 487
  • Number of attempts: 12
Tabbed Table to Python Array - 643 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: #73 / 166
  • Number of attempts: 2
HS exam question - 1497 entries

Convert the data to a python dictionary

  • Best score: 47
  • Best player score: 48
  • Position: #33 / 393
  • Number of attempts: 14
Reformat symbols in list - 1466 entries

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

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

Based off of something I saw on reddit

  • Best score: 28
  • Best player score: 43
  • Position: #61 / 88
  • Number of attempts: 3
Poorly indented Python comments - 1160 entries

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

  • Best score: 15
  • Best player score: 15
  • Position: #32 / 202
  • Number of attempts: 16
2 quick changes and a numbered list - 599 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: #99 / 145
  • Number of attempts: 2
delete swap - 1522 entries

delete all swap

  • Best score: 5
  • Best player score: 5
  • Position: #198 / 476
  • Number of attempts: 5
Generate a very basic Python constructor (fixed) - 1172 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: #121 / 245
  • Number of attempts: 4
Visual block training - 1001 entries

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

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

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

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

Convert the wikitext headings to markdown.

  • Best score: 20
  • Best player score: 31
  • Position: #139 / 203
  • Number of attempts: 1
hello-world-vimgolf - 2346 entries

Simple number generation

  • Best score: 10
  • Best player score: 10
  • Position: #252 / 663
  • Number of attempts: 4
Fill in the chess board - 905 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: #60 / 175
  • Number of attempts: 9
Plotting some variables in python - 1558 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: #232 / 333
  • Number of attempts: 2
Lowercase first characters - 467 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: #112 / 175
  • Number of attempts: 3
Python dataclasses - 1104 entries

Simple challenge to extract fields from a Python class

  • Best score: 19
  • Best player score: 41
  • Position: #251 / 277
  • Number of attempts: 1
Modernise code - 1333 entries

Modernise and clean up some C++ code.

  • Best score: 34
  • Best player score: 48
  • Position: #210 / 307
  • Number of attempts: 1
HS Final exam vimgolf - 864 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 / 227
  • 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 - 2329 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: #191 / 457
  • Number of attempts: 5
Add quotes to ansible playbook - 926 entries

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

  • Best score: 8
  • Best player score: 9
  • Position: #189 / 295
  • Number of attempts: 4
Multiline to Single Line - 668 entries

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

  • Best score: 5
  • Best player score: 5
  • Position: #216 / 292
  • 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 - 2001 entries

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

  • Best score: 18
  • Best player score: 19
  • Position: #214 / 516
  • 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