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]

39469 active golfers, 469608 entries, 601 challenges

Open VimGolf challenges

Nested JSON Flattener - 6 entries

Transform a deeply nested JSON structure into a flattened key-value format where each path is represented by dot notation

The Fibonacci Spacer - 27 entries

Split the words, remove punctuation and add spaces before each line following the Fibonacci sequence (0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89)

Replace markdown sections with numbering - 78 entries

Replace each section and subsection with their respective numbers

Fix the Scala Method - 66 entries

Fix the missing semicolons and the Int type, ensure the floating point division, and remove the unnecessary return.

Change class fields from camel case to snake case - 227 entries

This is the reverse of the previous challenge: https://www.vimgolf.com/challenges/9v006705493c000000000513

Change class fields from snake case to camel case - 107 entries

Change the class fields in this Scala class from snake case to camel case

Reorganize Pokémon - 236 entries

Change the format of the each line and sort alphabetically.

Replace csv column if it's not empty - 78 entries

Replace the credit_score_percentile column with the value 0.0 but leave the empty ones untouched

Convert plain text into a markdown table - 16 entries

Convert the table to markdown to make it more usable

Change readonly files - 18 entries

Try to write a file that was marked as read-only.

extract struct tag in go - 27 entries

Can you extract all struct tags in the fewest keystrokes possible?

CaN yOuR ViM dO ThAt? #2 - 28 entries

Tsoding's famous "Can your Vim do that?" https://www.youtube.com/watch?v=F4xc4jQO7ck&t=1429s

CaN yOuR ViM dO ThAt? #1 - 59 entries

Tsoding's famous "Can your Vim do that?" https://youtu.be/Bafo3hhheHU?si=DfcT4sUEMTSAevnx&t=1091

Append leading hyphen count to each line - 38 entries

Append the number of leading hyphens to the end of each line.

Move list of uuids into a SQL query - 55 entries

Take the list of UUIDs and use them as a filter in the where statement of a SQL query

Markdown Blog Editing - 245 entries

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

Word completion - 166 entries

Try to complete these options within 20 keystrokes.

Fix timezone format - 215 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;`

Search different SQL column with similar where clause - 145 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.

Remove adjacent duplicates - 424 entries

Try to find a way to remove adjacent duplicate letters.

Move to corresponding lines - 219 entries

Move the values to the corresponding lines.

Rearrange array to single level - 1245 entries

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

Rearrange array to one line - 578 entries

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

Copy punctuation - 479 entries

I want to copy the last line’s brackets, quotes, and commas to each line. How?

Change LaTex itemizations formats - 103 entries

Inspired by the way my professor formats their LaTeX assignments.

Column wise pasting - 163 entries

Make a table from 3 columns

Deleting text - 245 entries

Delete everything except some specific numbers.

Resolve the spreadsheet - 22 entries

Replace the formulas in column C with the resulting values. Divisions by zero result in NaN. Operations with NaN also result in NaN.

Case matching substitution - 55 entries

Swap every "lorem" for "ipsum", keeping the letter cases the same.

Define Gray code states - 36 entries

List the states using Gray code and assign Gray code values to each state.

Hex to binary - 88 entries

Convert hexadecimal numbers into binary format.

Count words - 62 entries

Merge duplicates and count each word.

String decompression - 31 entries

3a4b2c => aaabbbbcc. Start a new line when you exceed 79 columns.

Reverse even lines - 32 entries

Reverse only the even lines without altering the odd lines.

Format a long line - 80 entries

Reformat long lines (gq), textwidth=78, no trailing spaces.

Evil Numbers - 73 entries

Print the first 100 evil numbers https://oeis.org/A001969. This is an advert for code.golf https://code.golf/evil-numbers#viml

Mirror image - 69 entries

Add the second eye

Find anomalies - 127 entries

There is one special character per line

Coordinate extraction - 51 entries

Get the coordinates of all "M"s from the Vim logo

Morse - 142 entries

Translate Morse code to Text

New teacher - 870 entries

Update the details of the new CS teacher.

Truth Table to ModelSim - 58 entries

Convert this truth table to simulator instructions!

Replace word while reserving first letter case - 576 entries

Window -> Door window -> door Windows -> Windows windows -> windows

months to html list items - 974 entries

Turn the months into list items.

Instance creation in Verilog - 41 entries

Creating an instance of a module is a very frequent task in Verilog. Let's see how efficiently can it be done

Quicksort - 1898 entries

We need the numbers in the first row sorted as quickly as possible! Be careful not to disturb the data below the divider though: that must remain unchanged.

EDN reformat - 1140 entries

The goal is to make the code more readable and concise while maintaining its functionality.

Tic-Tac-Toe Grid Transformation - 381 entries

Your mission is to efficiently convert the original Tic-Tac-Toe grid, represented by 'x's and 'o's, into a neat and well-organized game board.

Pick and sort servers from mirror list - 412 entries

Retrieve the primary server for each country from a mirror list file and organize them alphabetically by country name. Given a mirror list file containing server information for various countries, the objective is to extract the primary server from each country and then arrange these servers in alphabetical order based on the respective country names.

Populate 3D bone names list - 617 entries

Ran into this at work, excited to see how this gets optimized

VimGolf Chatter