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]

28148 active golfers, 330968 entries, 478 challenges

Open VimGolf challenges

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

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...

maximun and minimun - 46 entries

Find the maximum and minimum of the rows.

range(10) digit rotation - 32 entries

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

Fibonacci Triangles - 41 entries

Triangles

Back to the Future - 3 entries

We can't just time-travel around without first making sure our code is pretty and columns are aligned. And keeping lines with at most 80 characters should help if we ever need to review the code while we're stuck in the past. This is my first challenge. I tried being creative and even did a bit of research, so I hope you enjoy it.

TAR archive pretty print - 14 entries

Will you use isk ?

XML to JSON - 41 entries

Convert this xml file into json.

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!

Simple Maths - 30 entries

Not much to say, discover by yourself!

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

Rename everything like MY_VAR_SOMETHING to MyVarSomething.

LaTeX to XML Math Delimiters - 39 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>"

Palindrome numbers - 15 entries

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

Config Sections - 29 entries

Section me!

sort python functions and methods alphabetically - 13 entries

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

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.)

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'.

mp3 - Cutlist - 13 entries

An audio CD was accidentally ripped into one single mp3 file. A dummy cue-file now needs to be filled out with the correct values to get single mp3 files.

No naked if allowed! - 23 entries

House style forbids naked condition statements, comments should start with a space character and be on their own line. Good luck!

Acute accents - 28 entries

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

199 Fibonacci Numbers - 35 entries

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

Splits long lines in more readable ones - 10 entries

Those tests have too long lines. We have to split the to have more readable ones. This is based on a real project with Ruby and RSpec.

Lenny Spiral - 10 entries

Make one lenny into an infinite army of lennys.

citizen_hacks_2019_part4 - 3 entries

For the Citizen Hacks 2019 Vim competition

citizen_hacks_2019_part3 - 3 entries

For the Citizen Hacks 2019 Vim competition

citizen_hacks_2019_part2 - 3 entries

For the Citizen Hacks 2019 Vim competition

Convert pasted text into Markdown - 17 entries

I often need to copy/paste text into Markdown files. The challenge here is to wrap the lines in a way that prefers breaks after periods, commas, or other logical demarcations. There should be no spaces at the beginning of a line.

Conway sequence - 21 entries

Generate the the first fifteen numbers. See here for more information: http://en.wikipedia.org/wiki/Look-and-say_sequence

VimGolf Chatter