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]

Played Challenges

Put a newline after every 10 lines in vim - 1664 entries

Goal is to put a newline after every 10 lines in vim.

  • Best score: 10
  • Best player score: 12
  • Position: #209 / 559
  • Number of attempts: 2
Making 3 line function a one liner. - 340 entries

Simple challenge for frequent action while programming.

  • Best score: 4
  • Best player score: 4
  • Position: #73 / 209
  • Number of attempts: 1
Simple, Practical, and Common - 33757 entries

Simple things we do all the time should be able to be done with very few keystrokes, but sometimes I find something I need to do makes me go, "There MUST be a better way." This challenge is just a simple movement and entering text at a certain place.

  • Best score: 22
  • Best player score: 28
  • Position: #4440 / 7450
  • Number of attempts: 1
Swap values - 4644 entries

Well, swap the values...

  • Best score: 11
  • Best player score: 15
  • Position: #950 / 1275
  • Number of attempts: 2
prepend * to every non-blank line - 6358 entries

Prepend an asterisk to every non-blank line in the input file.

  • Best score: 10
  • Best player score: 11
  • Position: #760 / 1551
  • Number of attempts: 4
One number per line - 18784 entries

Just give me the numbers.

  • Best score: 14
  • Best player score: 20
  • Position: #2248 / 3878
  • Number of attempts: 5
citizen_hacks_2019_challenge2 - 200 entries

For the Citizen Hacks 2019 Vim competition.

  • Best score: 6
  • Best player score: 6
  • Position: #39 / 103
  • Number of attempts: 2
Unsemantic linewrapping - 933 entries

[Inspired by a blog post I read: https://scott.mn/2014/02/21/semantic_linewrapping/. Text adapted.] Sometimes when editing a Markdown file, I wrap the lines semantically. Instead of inserting a newline at 70 columns (or whatever), or making paragraphs one long line, I put in newlines at a point that seems logical to me. This may seem silly, but it produces better diffs. Semantic linewrapping also makes editing snappier. I can delete, edit or insert sentences easily using linewise operations. Code-oriented text editors like Vim and [REDACTED] are really good at this kind of manipulation. Editing text that hasn't been wrapped semantically is a pain, though:

  • Best score: 9
  • Best player score: 10
  • Position: #136 / 232
  • Number of attempts: 1
V to the i - 4824 entries

Input is 99 V's. Output is 100 i's.

  • Best score: 7
  • Best player score: 8
  • Position: #1429 / 1899
  • Number of attempts: 1
Add semicolons - 10891 entries

Simply add a semicolon at the end of each line

  • Best score: 10
  • Best player score: 12
  • Position: #1811 / 3077
  • Number of attempts: 3
remove lines containing the word "reader" - 3614 entries

easy stuff

  • Best score: 9
  • Best player score: 10
  • Position: #650 / 1173
  • Number of attempts: 3
Box it - 7954 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 21
  • Position: #217 / 1886
  • Number of attempts: 4
Cool or not? - 836 entries

abc trying to be cool or not...

  • Best score: 15
  • Best player score: 18
  • Position: #135 / 231
  • Number of attempts: 1
From argument to object - 1524 entries

This task typifies those programmers endure while coding. This C-family pseudocode needs a function argument to be repurposed as an object call. Simply search and replace? Repeat a pattern of edits?

  • Best score: 17
  • Best player score: 19
  • Position: #310 / 463
  • Number of attempts: 1
Search and Replace 0 - 5007 entries

Replace every instance of 'aaa' with 'xaaax'.

  • Best score: 12
  • Best player score: 12
  • Position: #626 / 1631
  • Number of attempts: 1
Number Sort - 317 entries

sort the list of newline-separated numbers incrementally. Numbers are in the range 1 to 1000, with 500 missing

  • Best score: 9
  • Best player score: 9
  • Position: #107 / 169
  • Number of attempts: 2
Just the middle - 11500 entries

Delete the instructions at the top and bottom.

  • Best score: 7
  • Best player score: 8
  • Position: #2901 / 4216
  • Number of attempts: 4
Team names - 1846 entries

The team names are misspelled.

  • Best score: 16
  • Best player score: 18
  • Position: #394 / 591
  • Number of attempts: 1
Basic renumbering - 5685 entries

Renumbering Basic.

  • Best score: 11
  • Best player score: 14
  • Position: #501 / 1270
  • Number of attempts: 3
Vice versa - 7968 entries

Little role switching.

  • Best score: 12
  • Best player score: 15
  • Position: #1107 / 2144
  • Number of attempts: 2
Triangle of arrows - 199 entries

I made this by accident when working on another challenge. How would you go about making this?

  • Best score: 14
  • Best player score: 25
  • Position: #31 / 44
  • Number of attempts: 1
citizen_hacks_2019_challenge5 - 147 entries

For the Citizen Hacks 2019 Vim competition.

  • Best score: 6
  • Best player score: 6
  • Position: #18 / 77
  • Number of attempts: 1
Line under headers - 2068 entries

Put a line under each header, and remove the other markdown formatting.

  • Best score: 24
  • Best player score: 30
  • Position: #285 / 508
  • Number of attempts: 1
citizen_hacks_2019_challenge6 - 65 entries

For the Citizen Hacks 2019 Vim competition.

  • Best score: 3
  • Best player score: 3
  • Position: #16 / 51
  • Number of attempts: 1
Delete to the end of the current line - 849 entries

Delete to the end of the current line, but keep the character under the cursor.

  • Best score: 5
  • Best player score: 5
  • Position: #163 / 407
  • Number of attempts: 1
change parenthesis - 296 entries

change the pair of braces into a pair of parentheses

  • Best score: 9
  • Best player score: 9
  • Position: #69 / 161
  • Number of attempts: 1
Collect List - 4308 entries

Convert to comma separated list.

  • Best score: 12
  • Best player score: 12
  • Position: #441 / 1192
  • Number of attempts: 1
I forgot quotes - 16051 entries

Oops.

  • Best score: 10
  • Best player score: 14
  • Position: #1889 / 4194
  • Number of attempts: 2
-a-b-c- - 3216 entries

Put hyphens everywhere.

  • Best score: 13
  • Best player score: 15
  • Position: #712 / 1138
  • Number of attempts: 1
A HAPPY NEW YEAR 2014 ! - 10699 entries

A HAPPY NEW YEAR 2014 !

  • Best score: 11
  • Best player score: 15
  • Position: #3202 / 3695
  • Number of attempts: 1
Words in parens - 12969 entries

We should all ace this, right?

  • Best score: 13
  • Best player score: 16
  • Position: #2492 / 3970
  • Number of attempts: 1
Word frequency alignment - 291 entries

You've got to align the second column, but the spacing is inconvenient and there are nasty tabs in the way. If you're a "real Vim ninja," this could be very quick indeed...

  • Best score: 5
  • Best player score: 6
  • Position: #149 / 161
  • Number of attempts: 1
switch variable - 5085 entries

how fast can you switch two variable ?

  • Best score: 11
  • Best player score: 14
  • Position: #1436 / 1750
  • Number of attempts: 1
Numbering a List - 1939 entries

Pretty simple, number the list.

  • Best score: 13
  • Best player score: 13
  • Position: #49 / 655
  • Number of attempts: 2
Simple text editing with Vim - 13093 entries

Make the pairs of lines match up by making each second line same as first

  • Best score: 13
  • Best player score: 14
  • Position: #1839 / 3766
  • Number of attempts: 1
BESSENG A IREH Guy
Twitter:

entered into 35 challenges

contributed 0 challenges