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]

39586 active golfers, 470520 entries, 603 challenges

Open VimGolf challenges

Generate an entry for each month - 59 entries

The input file contains a URI with a month in it. Generate the URIs for all the other months up to a couple of years

Fix the git merge conflicts - 57 entries

Solve the merge conflicts in the Python file

Nested JSON Flattener - 15 entries

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

The Fibonacci Spacer - 40 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 - 139 entries

Replace each section and subsection with their respective numbers

Fix the Scala Method - 88 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 - 243 entries

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

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

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

Reorganize Pokémon - 261 entries

Change the format of the each line and sort alphabetically.

Replace csv column if it's not empty - 89 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 - 20 entries

Convert the table to markdown to make it more usable

Change readonly files - 25 entries

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

extract struct tag in go - 35 entries

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

CaN yOuR ViM dO ThAt? #2 - 33 entries

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

CaN yOuR ViM dO ThAt? #1 - 66 entries

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

Append leading hyphen count to each line - 47 entries

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

Move list of uuids into a SQL query - 64 entries

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

Markdown Blog Editing - 246 entries

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

Word completion - 178 entries

Try to complete these options within 20 keystrokes.

Fix timezone format - 220 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 - 168 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 - 437 entries

Try to find a way to remove adjacent duplicate letters.

Move to corresponding lines - 235 entries

Move the values to the corresponding lines.

Rearrange array to single level - 1267 entries

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

Rearrange array to one line - 588 entries

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

Copy punctuation - 483 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 - 168 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 - 82 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 - 74 entries

Add the second eye

Find anomalies - 142 entries

There is one special character per line

Coordinate extraction - 55 entries

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

Morse - 142 entries

Translate Morse code to Text

New teacher - 876 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 - 578 entries

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

months to html list items - 991 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 - 1916 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 - 1141 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.

VimGolf Chatter