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]

30167 active golfers, 368540 entries, 507 challenges

Open VimGolf challenges

C to VimDict - 44 entries

Convert a C data structure to a Vimscript dictionary.

Add links to an existing HTML table - 59 entries

Add these links at that top to the respective table cell. First link, first cell, etc.

fib.c cleanup - 58 entries

cleanup the file

Long prime list - filter version - 19 entries

I've used the maximum input/diff/output size allowed by vimgolf to get a list of integers up to 1460 separated by newlines, and your goal is to only keep the lines containing primes. There are 232 of them I hope some of you will golf vimscript itself to create some function to run as a primality check for each line, which is a good exercise if you haven't done much vimscript yet! You're invited to also try copy-pasting and doing other non-smart text manipulation. Even more interesting would be to see a solution that uses text manipulation to do the filtering! Whether you use vimscript, normal-mode primality checks, or text manipulation, as long as the end result is valid, your answer will be valid! Let's see which method does better here. Best of luck!

Merge blank lines and properly capitalize - 41 entries

Here you need complete 2 tasks: 1. Remove all unwanted continuous blank lines and leave only 1 blank line between paragraphs. 2. Properly capitalize the sentences.

Return the cow - 71 entries

This cow is too verbose. Give it a lesson.

SQL to YAML - 34 entries

Should be easy with vim, or not?

Greek column realign - 42 entries

Oops one letter is missing! Shift down the second column to insert nu letter. Symbol can be entered using: <C-K>n*

Coordinates placeholder - 56 entries

Place coordinates instead of target search.

Tiny column alignment - 39 entries

Align using the four blocks, don't forget to lowercase and have fun!

Binary and Increment - 41 entries

Some numbers fun: not only increasing numbers but also increasing binary.

Create bison tokens - 34 entries

Create tokens for bison out of a known list of words

50 factorials mod 97 - 38 entries

List 1! to 50!, but give your answer mod 97.

Flatten repo - 22 entries

For each git repository (<project> tag) translate name attribute to flatten directory structure. Add path attribute if missing (because checkout hierarchy must be kept). #xml

Enharmonic Equivalents - 52 entries

Transform # and b to digraphs

Converting group lines from format A to Format B - 20 entries

Convert from one format to another

Untangle my tail, please! - 45 entries

You know, this words were playing to chase their tails and Oops! What happened? Now we have a complete mess, their tails are totally tangled, can you please help them to untangle their tails?

C# function to F# - 4 entries

Converting from C# to F# is not hard, but requires some manual labor. Here you should convert a C# function using a C# class to a F# function using a C# class.

Convert regular pandoc footnotes to in-line notes - 51 entries

Pandoc extends markdown by allowing footnotes, which are usually represented with a footnote identifier followed later in the document by the footnote itself. But Pandoc also allows inline footnotes without identifiers. How many strokes does it take to convert regular footnotes to inline notes? (NB: I've had trouble figuring out whether text-width makes a difference to Vimgolf in comparing the input and output file. I finally tested this locally using the Vimgolf vimrc and did a "gq" on the entire buffer as the last step. Apologies if I'm making a newbie mistake. First time submitter.)

Sort by your own sum - 49 entries

Same numbers as last time, but you'll have to add them yourself.

un-C-escape string - 53 entries

Convert escape sequences to characters

maximun and minimun - 50 entries

Find the maximum and minimum of the rows.

Carriage return - 41 entries

I have some raw data from terminal output which uses carriege return for formatting. Carriage return sets the pointer to the first character on the line, and subsequent characters will overwrite what was there before. The challange is to simulate the terminal behaviour in vim. I'm kind of unsure if I should have skipped lines 9 and 15, since there might be some interesting solutions which are not that generic. Happy Golfing!

Maze path - 32 entries

Follow the given motions and mark your path with Xs. Attention: This maze is quite big (20x20), please set your terminal size to at least 82.

citizen_hacks_2019_part2 - 8 entries

For the Citizen Hacks 2019 Vim competition

Presidential Sorting - 47 entries

Given a nice CSV formatted arrangement of the Presidents of the United States, we need to print out an alphabetical list in pretty columns. Prove that vim can conquer this basic Excel task!

Simple Maths - 35 entries

Not much to say, discover by yourself!

Extended Customer 2 - 44 entries

Format the chars

Under the cupola - 41 entries

Taking some liberty about the name and plot of the Stephen King's famous novel (and TV series) to make this challenge. Are you able to recreate graphically the key phrase of the story? (I think is gonna be hard!)

Sort with uniq OpenEmbedded package names - 33 entries

For each line take 4th dirname of path. For example: "alsa-utils", "gawk-3.1.5", ... But! But if previous result is "files", take 3rd dirname instead. For example: "mktemp", "mklibs" ... If version is present in package name (dash is the separator character), take it. For example: "apt-0.9.9.4" prevails over "apt". And finally, use sort -u to get unique names!

Across-Down Flip - 42 entries

Do this instead of the Sunday crossword.

Sort by sum of numbers in a line(?) - 45 entries

The lines with the biggest sums need to be at the top. The sums are on the right, which makes life hard. Maybe you can find a feature that will do all the work for you...

Kolakoski sequence -- level 2 - 10 entries

This time, the line above describes the line below. Level 1 at: http://www.vimgolf.com/challenges/5c880211ab65cb00065c74eb

XML to JSON - 44 entries

Convert this xml file into json.

TAR archive pretty print - 17 entries

Will you use isk ?

Custom McCarthy sequence - 31 entries

Generate the first one hundred and twenty numbers (starting with n=1). See here for some inspiration: http://en.wikipedia.org/wiki/McCarthy_91_function

range(10) digit rotation - 32 entries

This is a data generator challenge or some kind of gift..

Fibonacci Triangles - 41 entries

Triangles

citizen_hacks_2019_part9 - 7 entries

For the Citizen Hacks 2019 Vim competition

citizen_hacks_2019_part3 - 7 entries

For the Citizen Hacks 2019 Vim competition

LaTeX to XML Math Delimiters - 40 entries

Vim is amazing when used to edit MediaWiki text, but typing "<math> . . . </math>" can be tiresome and frustrating if formulas are used often. LaTeX delimiters are so concise and even come in two flavors: "\( . . . \)" for inline math and "\[ . . . \]" for centered formulas. The goal is to perform the following conversions: "\( . . . \)" becomes "<math>. . .</math>" "\[ . . . \]" becomes "<center><math>. . .</math></center>"

Acute accents - 31 entries

Featuring all 17 lowercase letters with an acute accent digraph. Find a way to automate the digraphs.

Hail to Alekseï Pajitnov - 30 entries

Wanna play tetris? Don't panic, it's quite long but there's no piece rotation. Little advice: source the file, Luke!

Palindrome numbers - 17 entries

For each number compute its associated palindrome. First number (first line) has been eaten! #prime

Refactor to Helpers - 45 entries

This Rails partial is almost all template escapes. Put it into a helper, and refactor each case to methods so we can build out the controls for each. (I've converted to tabs - fighting with Vimgolf's default config shouldn't be part of the challenge.)

Config Sections - 29 entries

Section me!

Change The Perspective - 36 entries

This is a go game recodes file(.sgf file, refer to http://www.red-bean.com/sgf/). It base on such a coordinate system: in vertical direction, is from top(farthest end) to bottom, mark as a,b,c,...,s(19*19 board); in horizontal direction, is from left to right, uses the same notations. For Example, the coordinate notation 'cq', is the position at the bottom-left corner(vertical coordinate first). The record is from one player's perspective. We need to change to another's, but we don't want to change coordinate system, let it keep top to bottom and left to right. so we have to change the coordinates, a <-> s, b <-> r,c <-> q, etc. the Position 'cq', as transformation, it will be 'qd'.

Forgot to follow the naming convention... - 25 entries

Rename everything like MY_VAR_SOMETHING to MyVarSomething.

199 Fibonacci Numbers - 36 entries

Generate 199 Fibonacci Numbers using, if you like, the function S(x,y), a vimscript to sum two big numbers in reverse order.

sort python functions and methods alphabetically - 14 entries

* sort functions in the python file alphabetically * sort functions within a Class alphabetically * sort Classes alphabetically

VimGolf Chatter