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

Swap columns and transform to CSV format - 386 entries

Turn this spreadsheet output into a CSV file but first swap the columns

  • Best score: 16
  • Best player score: 19
  • Position: #84 / 143
  • Number of attempts: 4
Fix the git merge conflicts - 286 entries

Solve the merge conflicts in the Python file

  • Best score: 36
  • Best player score: 69
  • Position: #61 / 78
  • Number of attempts: 2
Markdown Blog Editing - 434 entries

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

  • Best score: 30
  • Best player score: 43
  • Position: #41 / 101
  • Number of attempts: 6
Fix timezone format - 318 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: #48 / 101
  • Number of attempts: 3
Search different SQL column with similar where clause - 314 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: #49 / 69
  • Number of attempts: 2
Remove adjacent duplicates - 646 entries

Try to find a way to remove adjacent duplicate letters.

  • Best score: 19
  • Best player score: 23
  • Position: #72 / 162
  • Number of attempts: 3
Rearrange array to single level - 1631 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: #204 / 271
  • Number of attempts: 2
Rearrange array to one line - 758 entries

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

  • Best score: 13
  • Best player score: 27
  • Position: #144 / 182
  • Number of attempts: 3
months to html list items - 1108 entries

Turn the months into list items.

  • Best score: 22
  • Best player score: 30
  • Position: #225 / 300
  • Number of attempts: 1
Remove line numbers - 752 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 / 201
  • Number of attempts: 2
Find fix point of cos - 1444 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: #308 / 427
  • Number of attempts: 1
Paste a column after a column - 2632 entries

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

  • Best score: 14
  • Best player score: 17
  • Position: #237 / 570
  • Number of attempts: 6
Reformat symbols in list - 1635 entries

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

  • Best score: 24
  • Best player score: 34
  • Position: #222 / 352
  • Number of attempts: 1
2 quick changes and a numbered list - 648 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: #111 / 155
  • Number of attempts: 3
delete swap - 1818 entries

delete all swap

  • Best score: 5
  • Best player score: 5
  • Position: #370 / 567
  • Number of attempts: 2
Generate a very basic Python constructor (fixed) - 1281 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: #159 / 275
  • Number of attempts: 2
Fix the shell script! - 2651 entries

Fix the shell script with the fewest keystrokes!

  • Best score: 26
  • Best player score: 40
  • Position: #421 / 616
  • Number of attempts: 2
Applying same text modification in several lines - 2915 entries

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

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

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 11
  • Position: #1785 / 3085
  • Number of attempts: 7
remove lines containing the word "reader" - 3622 entries

easy stuff

  • Best score: 9
  • Best player score: 10
  • Position: #866 / 1177
  • Number of attempts: 4
Com(m)a Trouble - 3941 entries

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

  • Best score: 12
  • Best player score: 28
  • Position: #764 / 892
  • Number of attempts: 2
Search and Replace 0 - 5027 entries

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

  • Best score: 12
  • Best player score: 12
  • Position: #736 / 1637
  • Number of attempts: 3
Preferably without multi-cursor plugin - 549 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: #118 / 132
  • Number of attempts: 1
Python Hello World! Reformatting - 1007 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: #353 / 384
  • Number of attempts: 1
One to Ten - 2241 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 / 682
  • Number of attempts: 4
Change part of a function name in multiple occurrences - 672 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: #129 / 210
  • Number of attempts: 2
Increment each number - 1043 entries

Increment each number individually by one

  • Best score: 15
  • Best player score: 28
  • Position: #224 / 255
  • Number of attempts: 5
Delete to the end of the current line - 855 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 / 411
  • Number of attempts: 2
move titles next to url, in quotes - 551 entries

had trouble with something similar

  • Best score: 19
  • Best player score: 24
  • Position: #122 / 146
  • Number of attempts: 2
Words in parens - 12992 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 16
  • Position: #2545 / 3977
  • 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(#) - 2067 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: #358 / 480
  • Number of attempts: 2
Let's play some Ivmgolf - 1138 entries

Oops, I spelled that wrong.

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

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

  • Best score: 21
  • Best player score: 26
  • Position: #512 / 767
  • Number of attempts: 2
Switch function arguments - 2182 entries

How to switch two arguments of a function.

  • Best score: 11
  • Best player score: 12
  • Position: #340 / 674
  • Number of attempts: 4
Indentation - 552 entries

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

  • Best score: 20
  • Best player score: 27
  • Position: #87 / 181
  • Number of attempts: 8
Reverse characters in a line - 789 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: #227 / 269
  • Number of attempts: 3
Change the content of a string - 1707 entries

This docstring is a complete lie. Fix it.

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

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

  • Best score: 33
  • Best player score: 33
  • Position: #285 / 594
  • Number of attempts: 7
Braces or Brackets? - 1096 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: #183 / 339
  • Number of attempts: 3
Simple text editing with Vim - 13262 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 / 3810
  • Number of attempts: 7
Diwakar Singh Parmar
Github:

entered into 41 challenges

contributed 0 challenges