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]

39837 active golfers, 472382 entries, 608 challenges

Open VimGolf challenges

Sort and Tag - 1 entries

The goal is to sort these lines alphabetically, assign a unique identifier to each line in the format "[01]", "[02]", etc., and then restore the original order of the lines while preserving the assigned identifiers.

Changing date formats - 71 entries

Change the date format to Y/M/D.

YAML to dotenv - 90 entries

Convert this YAML config file to a .env file.

Change to ascending order - 139 entries

Change each line of numbers consistently from descending to ascending order.

Swap columns and transform to CSV format - 67 entries

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

Generate an entry for each month - 100 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 - 74 entries

Solve the merge conflicts in the Python file

Nested JSON Flattener - 18 entries

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

The Fibonacci Spacer - 52 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 - 144 entries

Replace each section and subsection with their respective numbers

Fix the Scala Method - 105 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 - 274 entries

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

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

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

Reorganize Pokémon - 301 entries

Change the format of the each line and sort alphabetically.

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

Convert the table to markdown to make it more usable

Change readonly files - 33 entries

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

extract struct tag in go - 42 entries

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

CaN yOuR ViM dO ThAt? #2 - 34 entries

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

CaN yOuR ViM dO ThAt? #1 - 77 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 - 68 entries

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

Markdown Blog Editing - 253 entries

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

Word completion - 179 entries

Try to complete these options within 20 keystrokes.

Fix timezone format - 225 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 - 445 entries

Try to find a way to remove adjacent duplicate letters.

Move to corresponding lines - 241 entries

Move the values to the corresponding lines.

Rearrange array to single level - 1298 entries

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

Rearrange array to one line - 602 entries

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

Copy punctuation - 487 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 - 172 entries

Make a table from 3 columns

Deleting text - 254 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 - 33 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 - 75 entries

Add the second eye

Find anomalies - 148 entries

There is one special character per line

Coordinate extraction - 55 entries

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

Morse - 148 entries

Translate Morse code to Text

New teacher - 923 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 - 604 entries

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

VimGolf Chatter