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

Simple, Practical, and Common - 32953 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: 26
  • Position: #3497 / 7275
  • Number of attempts: 2
prepend * to every non-blank line - 5977 entries

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

  • Best score: 10
  • Best player score: 16
  • Position: #944 / 1468
  • Number of attempts: 1
Swap values inside brackets - 2433 entries

Easy challenge.

  • Best score: 14
  • Best player score: 17
  • Position: #272 / 561
  • Number of attempts: 4
Bad Copy Syntax - 1938 entries

Copy should be from right to left, but sometimes you type it wrong.

  • Best score: 18
  • Best player score: 20
  • Position: #236 / 493
  • Number of attempts: 6
Box it - 7682 entries

Create a box around a line.

  • Best score: 21
  • Best player score: 24
  • Position: #894 / 1836
  • Number of attempts: 1
Start coding format - 133 entries

I used to start coding with following format: int main(){ -(cursor here) }

  • Best score: 22
  • Best player score: 24
  • Position: #57 / 65
  • Number of attempts: 1
Preferably without multi-cursor plugin - 476 entries

Originally asked as question on reddit by kpthunder: https://www.reddit.com/r/vim/comments/9fvsro/what_is_the_most_efficient_way_to_go_about/

  • Best score: 30
  • Best player score: 37
  • Position: #72 / 116
  • Number of attempts: 1
Number Sort - 286 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: 10
  • Position: #131 / 153
  • Number of attempts: 1
Python Hello World! Reformatting - 906 entries

A novice Python using prints Hello World! and a pro shows him different way. Using vim to get into pro style from novice, win the challenge.

  • Best score: 39
  • Best player score: 44
  • Position: #229 / 352
  • Number of attempts: 1
Mirrored text - 162 entries

backward and forward, and long enough to be challenging

  • Best score: 14
  • Best player score: 16
  • Position: #51 / 69
  • Number of attempts: 2
Swap assigned value - 561 entries

Simple problem but looking for interesting solutions.

  • Best score: 10
  • Best player score: 11
  • Position: #171 / 236
  • Number of attempts: 1
camel riding - 745 entries

add a prefix on some camelCase variables

  • Best score: 15
  • Best player score: 18
  • Position: #228 / 267
  • Number of attempts: 2
Logging with key - 292 entries

Sometimes it is better to log with meaningful key

  • Best score: 21
  • Best player score: 38
  • Position: #72 / 84
  • Number of attempts: 1
Mute the second method of this script - 439 entries

prepend a # infront of every line of the second method

  • Best score: 9
  • Best player score: 10
  • Position: #212 / 233
  • Number of attempts: 1
Happy TvvO - 392 entries

Don’t forget the past, learn from it. Happy New Year.

  • Best score: 12
  • Best player score: 12
  • Position: #131 / 195
  • Number of attempts: 3
Letter case trickery - 1553 entries

This file is in a downright esoteric format, consisting of hexadecimal numbers, non-hexadecimal keywords, and "Z" indicating end-of-line. Make the hexadecimal numbers lowercase.

  • Best score: 9
  • Best player score: 12
  • Position: #348 / 500
  • Number of attempts: 4
Remove noise from HTTP log - 663 entries

This piece of log (from the year 2000) contains some irrelevant data. We only want to see the HTTP method and resource.

  • Best score: 15
  • Best player score: 17
  • Position: #225 / 261
  • Number of attempts: 1
Increment, increment, increment.... - 591 entries

Vim likes macros

  • Best score: 10
  • Best player score: 12
  • Position: #325 / 378
  • Number of attempts: 3
Context Insensitive completion 1 - 436 entries

Finish writing this simple Python HTTP server.

  • Best score: 18
  • Best player score: 36
  • Position: #209 / 223
  • Number of attempts: 2
Whitespace, empty lines and tabs - 3009 entries

Convert tabs to spaces, strip empty lines and trailing whitespace.

  • Best score: 16
  • Best player score: 31
  • Position: #477 / 667
  • Number of attempts: 3
Simple text editing with Vim - 11657 entries

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

  • Best score: 13
  • Best player score: 14
  • Position: #1766 / 3418
  • Number of attempts: 2
Marius Jurgelenas
Twitter:

entered into 21 challenges

contributed 0 challenges