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

Markdown Blog Editing - 197 entries

Convert the given link text in start file to a markdown link list.

  • Best score: 30
  • Best player score: 43
  • Position: #23 / 52
  • Number of attempts: 6
Fix timezone format - 183 entries

Add the missing T and Z in the datetime field. There should be a T instead of the space, and a Z at the end of the datetime. `2024-08-31 18:32:00;` -> `2024-08-31T18:32:00Z;`

  • Best score: 15
  • Best player score: 17
  • Position: #32 / 60
  • Number of attempts: 3
Search different SQL column with similar where clause - 105 entries

Replace a column in the where clause and convert all numbers from text to numeric, by replacing the leading 0 with the code 359.

  • Best score: 22
  • Best player score: 28
  • Position: #27 / 35
  • Number of attempts: 2
Remove adjacent duplicates - 362 entries

Try to find a way to remove adjacent duplicate letters.

  • Best score: 19
  • Best player score: 23
  • Position: #41 / 101
  • Number of attempts: 3
Rearrange array to single level - 1092 entries

The goal is to flatten the array into a single list and remove any empty elements.

  • Best score: 14
  • Best player score: 35
  • Position: #142 / 184
  • Number of attempts: 2
Rearrange array to one line - 521 entries

Rearrange the array content on only one line, and remove trailing commas

  • Best score: 13
  • Best player score: 27
  • Position: #104 / 129
  • Number of attempts: 3
months to html list items - 957 entries

Turn the months into list items.

  • Best score: 22
  • Best player score: 30
  • Position: #193 / 254
  • Number of attempts: 1
Remove line numbers - 694 entries

From http://web.archive.org/web/20140831121704/http://dirac.org/linux/gdb/02a-Memory_Layout_And_The_Stack.php#investigatingthestackwithgdb.

  • Best score: 9
  • Best player score: 10
  • Position: #2 / 189
  • Number of attempts: 2
Find fix point of cos - 1339 entries

Write a function to find the fix point of cos. It is not a good code; It is just to use vim. Inspired by the excellent https://mvanier.livejournal.com/2897.html about the Y combinator.

  • Best score: 14
  • Best player score: 17
  • Position: #279 / 390
  • Number of attempts: 1
Paste a column after a column - 2504 entries

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

  • Best score: 14
  • Best player score: 17
  • Position: #226 / 547
  • Number of attempts: 6
Reformat symbols in list - 1606 entries

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

  • Best score: 24
  • Best player score: 34
  • Position: #217 / 344
  • Number of attempts: 1
2 quick changes and a numbered list - 642 entries

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

  • Best score: 37
  • Best player score: 59
  • Position: #109 / 153
  • Number of attempts: 3
delete swap - 1768 entries

delete all swap

  • Best score: 5
  • Best player score: 5
  • Position: #370 / 548
  • Number of attempts: 2
Generate a very basic Python constructor (fixed) - 1253 entries

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

  • Best score: 29
  • Best player score: 45
  • Position: #155 / 271
  • Number of attempts: 2
Fix the shell script! - 2544 entries

Fix the shell script with the fewest keystrokes!

  • Best score: 26
  • Best player score: 40
  • Position: #400 / 589
  • Number of attempts: 2
Applying same text modification in several lines - 2865 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #27 / 846
  • Number of attempts: 4
Add semicolons - 10845 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 11
  • Position: #1777 / 3060
  • Number of attempts: 7
remove lines containing the word "reader" - 3574 entries

easy stuff

  • Best score: 9
  • Best player score: 10
  • Position: #858 / 1158
  • Number of attempts: 4
Com(m)a Trouble - 3780 entries

Someone was real stupid when placing his commas. Can you fix it?

  • Best score: 12
  • Best player score: 28
  • Position: #730 / 855
  • Number of attempts: 2
Search and Replace 0 - 4964 entries

Replace every instance of 'aaa' with 'xaaax'.

  • Best score: 12
  • Best player score: 12
  • Position: #736 / 1617
  • Number of attempts: 3
Preferably without multi-cursor plugin - 540 entries

Originally asked as question on reddit by kpthunder: https://www.reddit.com/r/vim/comments/9fvsro/what_is_the_most_efficient_way_to_go_about/

  • Best score: 30
  • Best player score: 42
  • Position: #115 / 129
  • Number of attempts: 1
Python Hello World! Reformatting - 989 entries

A novice Python using prints Hello World! and a pro shows him different way. Using vim to get into pro style from novice, win the challenge.

  • Best score: 39
  • Best player score: 50
  • Position: #348 / 379
  • Number of attempts: 1
One to Ten - 2209 entries

Generate the sequence of numbers from 1 to 10, one number per line. Inspired by this Reddit thread: https://redd.it/ak4it2

  • Best score: 12
  • Best player score: 12
  • Position: #367 / 669
  • Number of attempts: 4
Change part of a function name in multiple occurrences - 661 entries

Change the middle part of the function name in multiple places, preferably using the next and dot commands.

  • Best score: 14
  • Best player score: 15
  • Position: #128 / 207
  • Number of attempts: 2
Increment each number - 1023 entries

Increment each number individually by one

  • Best score: 15
  • Best player score: 28
  • Position: #219 / 248
  • Number of attempts: 5
Delete to the end of the current line - 810 entries

Delete to the end of the current line, but keep the character under the cursor.

  • Best score: 5
  • Best player score: 5
  • Position: #268 / 389
  • Number of attempts: 2
move titles next to url, in quotes - 529 entries

had trouble with something similar

  • Best score: 19
  • Best player score: 24
  • Position: #118 / 139
  • Number of attempts: 2
Words in parens - 12928 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 16
  • Position: #2535 / 3960
  • Number of attempts: 2
Refactor arguments into object argument - 166 entries

A relatively common Javascript refactoring.

  • Best score: 48
  • Best player score: 69
  • Position: #39 / 68
  • Number of attempts: 2
Saving the hashes(#) - 2053 entries

The following file is copied from vimcasts.org(Its only for learning purpose,hope the site owner doesn't mind it), its probably the easiest of challenges.Our goal is to delete every line which doesn't contain a hash signs. The remaining hash signs with numbers are then sorted to get the final output.

  • Best score: 20
  • Best player score: 29
  • Position: #357 / 479
  • Number of attempts: 2
Let's play some Ivmgolf - 1118 entries

Oops, I spelled that wrong.

  • Best score: 7
  • Best player score: 7
  • Position: #145 / 445
  • Number of attempts: 4
Vertical Limit - 2522 entries

transform a succession of one word lines to a an array of strings

  • Best score: 21
  • Best player score: 26
  • Position: #503 / 751
  • Number of attempts: 2
Switch function arguments - 2117 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 12
  • Position: #335 / 657
  • Number of attempts: 4
Indentation - 534 entries

Indent each line according to the right number of spaces it needs.

  • Best score: 20
  • Best player score: 27
  • Position: #85 / 177
  • Number of attempts: 8
Reverse characters in a line - 750 entries

You have everything you need, just not in the right order. Mastermind would give you 26 white pegs.

  • Best score: 12
  • Best player score: 22
  • Position: #221 / 261
  • Number of attempts: 3
Change the content of a string - 1552 entries

This docstring is a complete lie. Fix it.

  • Best score: 22
  • Best player score: 22
  • Position: #229 / 580
  • Number of attempts: 3
Sort and add attributes - 1421 entries

Sort the states and add the attribute country to each record.

  • Best score: 33
  • Best player score: 33
  • Position: #285 / 552
  • Number of attempts: 7
Braces or Brackets? - 958 entries

Someone forgot whether to use braces or brackets and you have to clean up their code!

  • Best score: 34
  • Best player score: 46
  • Position: #169 / 306
  • Number of attempts: 3
Simple text editing with Vim - 12680 entries

Make the pairs of lines match up by making each second line same as first

  • Best score: 13
  • Best player score: 13
  • Position: #721 / 3665
  • Number of attempts: 7
Diwakar Singh Parmar
Github:

entered into 39 challenges

contributed 0 challenges