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 4fca76aad3a0d4000100007e

Calculate the table totals

Go ahead... commit the treachery of using vim as a spreadsheet.

Start file
+--------------+--------+----------+---------+
| Item         | Cost   | Amount   | Total   |
+==============+========+==========+=========+
| Apple        | 2.00   | 3        |         |
+--------------+--------+----------+---------+
| Orange       | 2.50   | 4        |         |
+--------------+--------+----------+---------+
| Banana       | 1.00   | 6        |         |
+--------------+--------+----------+---------+
| Kiwi         | 7.00   | 5        |         |
+--------------+--------+----------+---------+
| Mango        | 5.00   | 2        |         |
+--------------+--------+----------+---------+
| Plum         | 4.00   | 9        |         |
+--------------+--------+----------+---------+
| Nectarine    | 3.50   | 7        |         |
+--------------+--------+----------+---------+
| Watermelon   | 5.00   | 3        |         |
+--------------+--------+----------+---------+
| Grapes       | 4.00   | 2        |         |
+--------------+--------+----------+---------+
| Tangerine    | 5.00   | 6        |         |
+--------------+--------+----------+---------+
End file
+--------------+--------+----------+---------+
| Item         | Cost   | Amount   | Total   |
+==============+========+==========+=========+
| Apple        | 2.00   | 3        |    6.00 |
+--------------+--------+----------+---------+
| Orange       | 2.50   | 4        |   10.00 |
+--------------+--------+----------+---------+
| Banana       | 1.00   | 6        |    6.00 |
+--------------+--------+----------+---------+
| Kiwi         | 7.00   | 5        |   35.00 |
+--------------+--------+----------+---------+
| Mango        | 5.00   | 2        |   10.00 |
+--------------+--------+----------+---------+
| Plum         | 4.00   | 9        |   36.00 |
+--------------+--------+----------+---------+
| Nectarine    | 3.50   | 7        |   24.50 |
+--------------+--------+----------+---------+
| Watermelon   | 5.00   | 3        |   15.00 |
+--------------+--------+----------+---------+
| Grapes       | 4.00   | 2        |    8.00 |
+--------------+--------+----------+---------+
| Tangerine    | 5.00   | 6        |   30.00 |
+--------------+--------+----------+---------+

View Diff

4c4
< | Apple        | 2.00   | 3        |         |
---
> | Apple        | 2.00   | 3        |    6.00 |
6c6
< | Orange       | 2.50   | 4        |         |
---
> | Orange       | 2.50   | 4        |   10.00 |
8c8
< | Banana       | 1.00   | 6        |         |
---
> | Banana       | 1.00   | 6        |    6.00 |
10c10
< | Kiwi         | 7.00   | 5        |         |
---
> | Kiwi         | 7.00   | 5        |   35.00 |
12c12
< | Mango        | 5.00   | 2        |         |
---
> | Mango        | 5.00   | 2        |   10.00 |
14c14
< | Plum         | 4.00   | 9        |         |
---
> | Plum         | 4.00   | 9        |   36.00 |
16c16
< | Nectarine    | 3.50   | 7        |         |
---
> | Nectarine    | 3.50   | 7        |   24.50 |
18c18
< | Watermelon   | 5.00   | 3        |         |
---
> | Watermelon   | 5.00   | 3        |   15.00 |
20c20
< | Grapes       | 4.00   | 2        |         |
---
> | Grapes       | 4.00   | 2        |    8.00 |
22c22
< | Tangerine    | 5.00   | 6        |         |
---
> | Tangerine    | 5.00   | 6        |   30.00 |

Solutions

The best way to learn is to practice. Below, you will find some of the solutions other golfers have entered. To unlock higher ranked solutions, submit your own entry which does as well or better than the solutions you can currently see - climb the ladder!

Check out these helpful resources to improve your Vim skills... Game on.

Unlock 30 remaining solutions by signing in and submitting your own entry
#31 John Whitley / johnwhitley - Score: 78 - 06/03/12 @ 02:18
jqq++f|l"ayt f|ll"bylf|lR<C-R>=<C-R>a*<C-R>b<CR>0<Esc>q9@q:%s/\(\d\+\.\d\d\)\( *\)  |$/ \2\1 |<CR>ZZ

0 comments

#32 lauri lehmijoki / laurilehmijoki - Score: 78 - 06/03/12 @ 10:56
jqq0jj/\d<CR>"ayt f|w"byl2f|6hR<C-R>=<C-R>a*<C-R>b<CR>0<Esc>q9@q:%s/\s\{3\}\(\d\.00\)\s\s/    \1 <CR>ZZ

0 comments

#33 何晨 / hechen0_ - Score: 80 - 09/22/16 @ 17:36
:g/0/norm 3W"nyE2W"myl40|R<C-V><C-R><C-V>=<C-V><C-R>n*<C-V><C-R>m<C-V><CR>0<CR><CR>:%s/\<BS><BS><BS><BS>%s/\v\|  (.*)  \|/|   \1 |<CR>ZZ

0 comments

#34 retro / tryphopp - Score: 118 - 12/23/15 @ 04:12
$3j5hR6.00<Esc>jj4hR10.00<Esc>jj3hR6.00<Esc>jj4hR35.00<Esc>jj4hR10.00<Esc>jj4hR36.00<Esc>jj4hR24.50<Esc>jj4hi15.00<Esc>lxxxxxjj5hlR8.00<Esc>jj4hR30.00<Esc>:x<CR>

0 comments

#35 Eric Söderström / eksoderstrom - Score: 137 - 07/19/12 @ 19:07
jjj<Esc>$hhhhhR6.00<Esc>jjhhhhR10.00<Esc>jjhhhR6.00<Esc>jjhhhhR35.00<Esc>jjhhhhR10.00<Esc>jjhhhhR36.00<Esc>jjhhhhR24.50<Esc>jjhhhhR15.00<Esc>jjhhhhR8.00<Esc>lxbbbi <Esc>jjR30.00<Esc><Esc>ZZ

0 comments

#36 Asenar / asenar - Score: 162 - 06/02/12 @ 21:32
:<Up><Up>%s#\(\(\d.\d\d\)   | \(\d\)        |   \).*#\=submatch(1) . float2nr(str2float(submatch(2))*str2float(submatch(3))) . ".00 |"<CR>gg/6<CR>i <Esc><Down><Down><Down><Down>i <Esc>/24<CR>a<Right><Right>5<Del><Esc>/8<CR>i <Esc>ZZ

0 comments

#37 Noel Alejandro / noelrock333 - Score: 177 - 06/22/12 @ 23:17
)*<Right>3j$hhC<Esc>uR6.<Esc>uhhR6.00<Esc>3hi<BS><Esc>$i <Esc>[{hhhhh2jR10.00<Left><Left><Esc>yw2j2hu<C-R>2jlRr<BS>6<Esc>p<Esc>u<Right>R.00<Left><Left><Left><Left>2j<Esc>u<Esc>2jhR35.00<Esc>2jia<Esc>u<Left><Left><Left><Left>R10.00<Esc>8W2Wh5hR36.00<Esc>2j4hR34<BS><BS>24.50<Esc>2j4hR15.00<Esc>2j3hR8.00<Esc>2j4hR30.00<Esc>:w<CR><C-W>q

0 comments

#38 Benjamin Sergeant / bsergean - Score: 200 - 06/05/12 @ 04:57
2ju<C-O>3j4f|hhhhqq.00$hhhhqqqi.<Esc>ur.lr0lr0qjjhh.u@qj2kj2j2h.xuuuuuuuuuuuqqr.0ll$uuuqqr.lr0lr02h2jq@q@q@qqqr.lr0l.2h2jq@q7@q@qk2hlhr3lr0kkr82kr5hr12kr2lr4f0r52k3h33l5hr6hr32kr1lr02kr5hr32klr62kr0hr12klr6ZZ

0 comments

Created by: connermcd

38 active golfers, 105 entries

Leaderboard (lowest score wins):
33
#1 - Conner McDaniel / connermcd

06/03/2012 at 01:05AM

33
#2 - Tim Chase / gumnos

06/03/2012 at 02:56AM

33
#3 - Urtica dioica / udioica

07/20/2012 at 09:04PM

33
#4 - Sean Griffin / sgrif

08/13/2012 at 02:33AM

33
#5 - Victor Ramirez / virako

01/24/2013 at 12:18AM

33
#6 - Ingo / ist3fani

06/01/2013 at 04:55PM

33
#7 - Joonas Pihlajamaa / jokkebk

03/18/2014 at 11:45AM

33
#8 - John Braxler / braxler

08/20/2014 at 07:51PM

34
#9 - Justin Love / wondible

06/03/2012 at 12:45AM

34
#10 - 無ん垢の叫び / john_ababa

06/03/2012 at 02:28AM

34
#11 - Rod Knowlton / codelahoma

06/03/2012 at 08:08PM

34
#12 - Dave / zzdave13

06/07/2012 at 08:35PM

34
#13 - Édouard M'tou / DouardM

10/08/2012 at 02:00PM

34
#14 - pftb12345 / pftb12345

05/02/2015 at 01:02PM

45
#15 - James Davis / tripvg

08/04/2012 at 05:40AM

46
#16 - h_east (トロッコ6個) / h_east

06/03/2012 at 10:51AM

47
#17 - Mister Knister / vimgolf_ctrl_x

03/04/2016 at 02:49PM

49
#18 - Kerson Hsiao / KersonHsiao

06/10/2012 at 06:11PM

51
#19 - Benoit Mortgat / Benoit_Mortgat

06/05/2012 at 04:41AM

51
#20 - Runar / runarfu

01/12/2013 at 11:15AM

51
#21 - Super Garbage / SuperGarbage0

08/26/2013 at 12:27AM

52
#22 - Jonathan Lozinski / jlozinski

06/03/2012 at 04:10PM

53
#23 - Javier Blanco / jbgutierrez

06/06/2012 at 11:04PM

55
#24 - Asmund Liseth / Asmund_L

06/20/2012 at 08:17PM

59
#25 - William Dunand / wdunand

07/27/2012 at 06:56AM

65
#26 - Yann Moisan / YannMoisan

01/01/2014 at 10:57PM

66
#27 - Pandae / psasqw

06/25/2012 at 01:35PM

68
#28 - Jason Wolf / zephyr_wolf

11/08/2012 at 07:09PM

71
#29 - Chris Brown / engineercyb

07/12/2012 at 09:48PM

71
#30 - Maksim S. / waynesayonara

09/02/2012 at 03:42PM

78
#31 - John Whitley / johnwhitley

06/03/2012 at 02:18AM

78
#32 - lauri lehmijoki / laurilehmijoki

06/03/2012 at 10:56AM

80
#33 - 何晨 / hechen0_

09/22/2016 at 05:36PM

118
#34 - retro / tryphopp

12/23/2015 at 04:12AM

137
#35 - Eric Söderström / eksoderstrom

07/19/2012 at 07:07PM

162
#36 - Asenar / asenar

06/02/2012 at 09:32PM

177
#37 - Noel Alejandro / noelrock333

06/22/2012 at 11:17PM

200
#38 - Benjamin Sergeant / bsergean

06/05/2012 at 04:57AM