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]

39211 active golfers, 467104 entries, 597 challenges

Open VimGolf challenges

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

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

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

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

Reorganize Pokémon - 37 entries

Change the format of the each line and sort alphabetically.

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

Convert the table to markdown to make it more usable

Change readonly files - 3 entries

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

extract struct tag in go - 11 entries

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

CaN yOuR ViM dO ThAt? #2 - 7 entries

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

CaN yOuR ViM dO ThAt? #1 - 26 entries

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

Append leading hyphen count to each line - 15 entries

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

Move list of uuids into a SQL query - 39 entries

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

Markdown Blog Editing - 197 entries

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

Word completion - 116 entries

Try to complete these options within 20 keystrokes.

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;`

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.

Remove adjacent duplicates - 364 entries

Try to find a way to remove adjacent duplicate letters.

Move to corresponding lines - 182 entries

Move the values to the corresponding lines.

Rearrange array to single level - 1093 entries

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

Rearrange array to one line - 521 entries

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

Copy punctuation - 419 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 - 133 entries

Make a table from 3 columns

Deleting text - 217 entries

Delete everything except some specific numbers.

Resolve the spreadsheet - 21 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 - 45 entries

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

Define Gray code states - 30 entries

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

Hex to binary - 78 entries

Convert hexadecimal numbers into binary format.

Count words - 49 entries

Merge duplicates and count each word.

String decompression - 27 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 - 71 entries

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

Evil Numbers - 72 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 - 125 entries

There is one special character per line

Coordinate extraction - 51 entries

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

Morse - 131 entries

Translate Morse code to Text

New teacher - 836 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 - 563 entries

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

months to html list items - 957 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 - 1875 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 - 1133 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 - 409 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 - 589 entries

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

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.

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.

Insert column data on Confluence-style table - 445 entries

Add ip addresses into new "IP" column based on the last digits from the "Server" column

Surround the 'z' character with brackets, quotes, and print as formatted string. - 538 entries

Surround the 'z' character with brackets, quotes, and print as formatted string.

VimGolf Chatter