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

Remember FizzBuzz?

Output FizzBuzz to 100. Start with nothing.

Start file

End file
1
2
3 Fizz
4
5 Buzz
6 Fizz
7
8
9 Fizz
10 Buzz
11
12 Fizz
13
14
15 FizzBuzz
16
17
18 Fizz
19
20 Buzz
21 Fizz
22
23
24 Fizz
25 Buzz
26
27 Fizz
28
29
30 FizzBuzz
31
32
33 Fizz
34
35 Buzz
36 Fizz
37
38
39 Fizz
40 Buzz
41
42 Fizz
43
44
45 FizzBuzz
46
47
48 Fizz
49
50 Buzz
51 Fizz
52
53
54 Fizz
55 Buzz
56
57 Fizz
58
59
60 FizzBuzz
61
62
63 Fizz
64
65 Buzz
66 Fizz
67
68
69 Fizz
70 Buzz
71
72 Fizz
73
74
75 FizzBuzz
76
77
78 Fizz
79
80 Buzz
81 Fizz
82
83
84 Fizz
85 Buzz
86
87 Fizz
88
89
90 FizzBuzz
91
92
93 Fizz
94
95 Buzz
96 Fizz
97
98
99 Fizz
100 Buzz

View Diff

1c1,100
< 
---
> 1
> 2
> 3 Fizz
> 4
> 5 Buzz
> 6 Fizz
> 7
> 8
> 9 Fizz
> 10 Buzz
> 11
> 12 Fizz
> 13
> 14
> 15 FizzBuzz
> 16
> 17
> 18 Fizz
> 19
> 20 Buzz
> 21 Fizz
> 22
> 23
> 24 Fizz
> 25 Buzz
> 26
> 27 Fizz
> 28
> 29
> 30 FizzBuzz
> 31
> 32
> 33 Fizz
> 34
> 35 Buzz
> 36 Fizz
> 37
> 38
> 39 Fizz
> 40 Buzz
> 41
> 42 Fizz
> 43
> 44
> 45 FizzBuzz
> 46
> 47
> 48 Fizz
> 49
> 50 Buzz
> 51 Fizz
> 52
> 53
> 54 Fizz
> 55 Buzz
> 56
> 57 Fizz
> 58
> 59
> 60 FizzBuzz
> 61
> 62
> 63 Fizz
> 64
> 65 Buzz
> 66 Fizz
> 67
> 68
> 69 Fizz
> 70 Buzz
> 71
> 72 Fizz
> 73
> 74
> 75 FizzBuzz
> 76
> 77
> 78 Fizz
> 79
> 80 Buzz
> 81 Fizz
> 82
> 83
> 84 Fizz
> 85 Buzz
> 86
> 87 Fizz
> 88
> 89
> 90 FizzBuzz
> 91
> 92
> 93 Fizz
> 94
> 95 Buzz
> 96 Fizz
> 97
> 98
> 99 Fizz
> 100 Buzz

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 120 remaining solutions by signing in and submitting your own entry
#121 Jason Then / racc69 - Score: 76 - 08/09/11 @ 00:26
Y99P:%s/^/\=line('.')/<CR>3GqqA Fizz<Esc>3jq32@qA Buzz<Esc>qq5kA Buzz<Esc>q18@q:%s/z /z/<CR>ZZ

0 comments


#122 Alex Hammel / AlexJHammel - Score: 76 - 12/24/12 @ 15:09
i1<Esc>qqYp<C-A>q98@q:%s/0\|5$/& Buzz<CR>$x^pkqqA Fizz<Esc>3kq32@q:%s/Buzz Fizz/FizzBuzz<CR>ZZ

0 comments


#123 Gurukandhamoorthi / Gurukandhamoor1 - Score: 78 - 07/28/17 @ 14:08
i1<CR><Esc>qqi<C-X><C-L><Esc><C-A>o<Esc>q98@qddggO<Esc><Esc>uqqjjA Fizz<Esc><CR>q99@qggqq4jA Buzz<Esc><CR>q99@q:%s/z B/x<BS>zB/<CR>ZZ

0 comments


#124 Andrey Ivanov / Bytamine - Score: 79 - 08/09/11 @ 12:19
i1<Esc>qayyp<C-A>q98@aggqbjjA Fizz<Esc>jq33@bggqc4jA Buzz<Esc>j^q20@c:%s/Fizz Buzz/FizzBuzz/|x<CR>

0 comments


#125 Oliver Christ / 0liverChrist - Score: 79 - 10/15/13 @ 21:43
99o<Esc>:%s/^/\=line(".")<CR>ggjjqaA  <BS>Fizz<Esc>3jq32@agg4jqaA +<BS>Buzz<Esc>5jq19@a:%s/z B/zB<CR>ZZ

0 comments


#126 Behnam Esfahbod / zwnj - Score: 80 - 12/31/10 @ 14:37
a <Esc>7a<CR><CR>Fizz<CR><CR>Buzz<CR>Fizz<CR><CR><CR>Fizz<CR>Buzz<CR><CR>Fizz<CR><CR><CR>FizzBuzz<CR><Esc>V5kx0i100<Esc>qqv0ykP<C-X>q98@qlxZZ

0 comments


#127 Ruy Diaz / diazruy - Score: 80 - 03/20/11 @ 02:11
Y99P:%s/^/\=line((<BS>'.')/<CR>ggjjqqA Fizz<Esc>3jq32@qA Buzz<Esc>qq5kA Buzz<Esc>q18@q:%s/z /z/<CR>ZZ

0 comments


#128 Jordan Lewis / JordanALewis - Score: 82 - 12/28/10 @ 23:42
iyyp<C-V><C-A><CR>3jAFizz<C-V><Esc><CR>5jABuzz<C-V><Esc><CR>gg"tDdd<Esc>^"gD@gGi1 <Esc>99@t@g33@t@gO<Esc>20@tggdd:%s/ $//<CR>ZZ

0 comments


#129 Vestrobaa / Vestrobaa - Score: 82 - 07/21/13 @ 21:05
i1<Esc>qao<C-R>=@.+1<CR><Esc>q98@aggqajjA Fizz<Esc>jq32@aggqa4jA Buzz<Esc>jq19@a:%s/Fizz Buzz/FizzBuzz<CR>ZZ

0 comments


#130 Karel Vervaeke / karel1980 - Score: 84 - 01/06/11 @ 21:02
99O<Esc>:%s/$/\=line('.').' '.(line('.')%3?'':'Fizz').(line('.')%5?'':'Buzz')<CR>:%s/ *$<CR>ZZ

0 comments


#131 Xavier Nayrac / lkdjiin - Score: 84 - 12/29/11 @ 15:38
99o<Esc>:%s/$/\=line('.').' '.(line('.')%3?'':'Fizz').(line('.')%5?'':'Buzz')<CR>:%s/ *$<CR>ZZ

0 comments


#132 Dhruva Sagar / dhruvasagar - Score: 88 - 12/29/10 @ 15:30
i1<Esc>qayyp<C-A>q98@aggqbjjA Fizz<Esc>jq33@bggqcjjjjA Buzz<Esc>j^q20@c:%^<BS>s/Fizz Buzz/FizzBuzz/|x<CR>

0 comments


#133 dominique pellé / vimgolfisto - Score: 90 - 01/01/11 @ 16:56
:for i in range(1,100)<CR>cal setli<Tab>i,i." ".(i%3?"":"Fizz").(i%5?"":"Buzz"))<CR>endfo<CR>:%s/ $/<CR>ZZ

0 comments


#134 Mike Plotz / antisuji - Score: 91 - 12/29/10 @ 03:17
i1<Esc>qqyyp<C-A>q13@qqqA Fizz<Esc>3kq4@qqq4jA Buzz<Esc>jq2@qbhxVgg"ayqq:g/^/normal 15<C-V><C-A><CR>gg"aPq5@q/101<CR>dGZZ

0 comments


#135 Jes / vim_jes - Score: 91 - 01/13/11 @ 23:11
:for x in range(1,100)|cal setline(x,x." ".(x%3?"":"Fizz").(x%5?"":"Buzz"))|endfo|%s/ $/<CR>ZZ

0 comments


#136 Peter Stuifzand / pstuifzand - Score: 94 - 12/29/10 @ 00:59
:for x in range(1,100)|cal setline(x,x." ".(x%3?"":"Fizz").(x%5?"":"Buzz"))|endfo|%s/ $/<CR>ZZ

0 comments


#137 akira_simpson / akira_simpson - Score: 95 - 02/02/12 @ 09:42
:for x in range(1,100)|cal setline(x,x." ".(x%3?"":"Fizz").*<BS>(x%5?"":"Buzz"))|n<BS>endfo|%s/ $/<CR>ZZ

0 comments


#138 Brent Carmer / brent_carmer - Score: 95 - 04/08/13 @ 04:25
:let x=1<CR>qqi<C-R>=x<CR> <C-R>=!(x%3)?"Fizz":""<CR><C-R>=<Up><Left><Left><Left><Left><BS><BS><BS><BS>Buzz<Left><Left><Left><Left><Left><Left><Left><BS>5<CR><CR><Esc>:let x+=1<CR>q99@qdd:%s/\<BS> $//<CR>:wq<CR>

0 comments


#139 mightyfoo / mightyfoo - Score: 96 - 05/25/11 @ 15:02
:for x in range(101)|cal setline(x,x.(x%3?(x%5?"":" Buzz"):" Fi".(x%5?"":"zzBu")."zz"))|endfo|x<CR>

0 comments


#140 foo / foo88832727 - Score: 97 - 10/18/13 @ 21:47
qq:let l=line('.')|let t=l%3|let f=l%5<CR>i<C-R>=l<CR><C-R>=t&&f?'':' '<CR><C-R>=t?'':'Fizz'<CR><C-R>=f?'':'Buzz'<CR><CR><Esc>q99@qddZZ

0 comments


#141 David Wolever / wolever - Score: 98 - 12/28/10 @ 23:46
:for i in range(1,100)<CR>cal setline(i,i." ".(i%3?"":"Fizz").(i%5?"":"Buzz"))<CR>endfor<CR>:%s/ $//<CR>:x<CR>

0 comments


#142 Aurélien Delahaye / alkove - Score: 101 - 12/30/10 @ 19:14
i1<Esc>qqYp<C-A>q98@q3ggqqA Fizz<Esc>2jA Buzz<Esc>jA Fizz<Esc>3jA Fizz<Esc>jA Buzz<Esc>8jq6@q12ggqqA Fizz<Esc>2jjA FizzBuzz<Esc>12jq5@qZZ

0 comments


#143 sathish316 / sathish316 - Score: 103 - 11/18/12 @ 18:58
o<Esc>98.:%s/^/\=line('.').(line('.')%3?"":"Fizz").(line('.')%5?"":"Buzz")/<CR>:%s/\(\d\+\)\(F\|B\)/\1 \2/g<CR>ZZ

0 comments


#144 timhoa / timhoa - Score: 112 - 03/06/11 @ 14:16
8i<CR><CR>Fizz<CR>Buzz<CR><CR>F<C-N><CR><CR><CR>F<C-N>Buzz<CR><CR><CR>F<C-N><CR><CR>B<C-N><CR>F<C-N><CR><Esc>d11kggd8j:redi => a|sil %nu|redi END|put=a<CR>:%s/^\<BS> \+\| \+$//g<CR>101GdggZZ

0 comments


#145 Justin Knag / justinknag - Score: 132 - 08/28/14 @ 16:56
i1<C-C><C-C>yyp<C-A>yy98puddqayyp<C-A>qw98@aggqb3jkqqba Fizz<C-C><C-C>3jq32@bgg4jqcA Buzz<C-C><C-C>5ja Buzz<C-C><C-C>5jaBuzz<C-C><C-C>5jq5@cjjjjjkkkkka Buzz<C-C><C-C>G<C-A>i<C-C><C-C>uA BUz<BS><BS>uzz<C-C><C-C><C-Z><C-Z>ZZ

0 comments


#146 Sebastian Morr / blinry - Score: 151 - 12/29/10 @ 09:20
s1<Esc>uc<Esc>kjg<Esc>isdf<Esc>hs<Esc>ulhr1c<Esc>ddr1<Esc>kjr1i1<Esc>uuudd<C-A>i0<Esc><C-A><Esc>uddi1<Esc>qqyyp<C-A>q98@qggdddGkjkji0<Esc>qqyyp<C-A><Esc>99<Esc>kjq99@qggqqjjjA Fizz<Esc>q99@qggqq5jA Buzz<Esc>q99@qggdd:%s/z /z<CR>:x<CR>

0 comments


#147 Pradeep Kumar / pradeep6kumar - Score: 209 - 04/25/13 @ 04:00
<Tab>i<Tab>1<Esc>qaYp<C-A>>>q98@a:%s/\v^(<Tab>[1<BS><BS>{15})+\1+(\d(\d+)?)/\2 FizzBuzz/g<CR>:<Up><Left><Left><Left><Left><Left><Left><BS><BS><BS><BS><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><BS><CR>:<Up><Up><Left><Left><BS><BS><BS><BS><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Right><Right><BS><BS>3<CR>:<Up><Left><Left><BS><BS><BS><BS><BS><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><BS><BS><BS><CR>ggd03GA Fizz<Esc>5GA Buzz<Esc>15Gaw<Esc>xwiFizz<Esc>ZZ

0 comments


#148 drio / drio - Score: 257 - 12/31/10 @ 00:48
<Esc>ifunction! W(c)<CR>let s:r=""<CR>if a:c%3==0<CR>let s:r=s:r."Fizz"<CR>end<CR>if a:c%5==0 <CR>let s:r=s:r."Buzz"<CR>end<CR>return empty(s:r) ? a:c : a:c." ".s:r<CR>endfunction<CR>function! R()<CR>for l in range(1, 100)<CR>call setline(l, W(l)) <CR>endfor<CR>endfunction<Esc>:w<CR><Esc>:source %<CR><Esc>:call R()<CR><Esc>:x<CR>

0 comments


#149 Baron Von Ernesto / excepttheweasel - Score: 559 - 12/29/10 @ 10:36
i1<CR>2<CR>3 Fizz<CR>4<CR>5 Buzz<CR>6 Fizz<CR>7<CR>8<CR>9 Fizz<CR>10 Buzz<CR>11<CR>12 Fizz<CR>13<CR>14<CR>15 FizzBuzz<CR>16<CR>17<CR>18 Fizz<CR>19<CR>20 Buzz<CR>21 Fizz<CR>22<CR>23<CR>24 Fizz<CR>25 Buzz<CR>26<CR>27 Fizz<CR>28<CR>29<CR>30 FizzBuzz<CR>31<CR>32<CR>33 Fizz<CR>34<CR>35 Buzz<CR>36 Fizz<CR>37<CR>38<CR>39 Fizz<CR>40 Buzz<CR>41<CR>42 Fizz<CR>43<CR>44<CR>45 FizzBuzz<CR>46<CR>47<CR>48 Fizz<CR>49<CR>50 Buzz<CR>51 Fizz<CR>52<CR>53<CR>54 Fizz<CR>55 Buzz<CR>56<CR>57 Fizz<CR>58<CR>59<CR>60 FizzBuzz<CR>61<CR>62<CR>63 Fizz<CR>64<CR>65 Buzz<CR>66 Fizz<CR>67<CR>68<CR>69 Fizz<CR>70 Buzz<CR>71<CR>72 Fizz<CR>73<CR>74<CR>75 FizzBuzz<CR>76<CR>77<CR>78 Fizz<CR>79<CR>80 Buzz<CR>81 Fizz<CR>82<CR>83<CR>84 Fizz<CR>85 Buzz<CR>86<CR>87 Fizz<CR>88<CR>89<CR>90 FizzBuzz<CR>91<CR>92<CR>93 Fizz<CR>94<CR>95 Buzz<CR>96 Fizz<CR>97<CR>98<CR>99 Fizz<CR>100 Buzz<Esc>:wq<CR>

0 comments


#150 Markus Schnell / m_schnell - Score: 1109 - 12/29/10 @ 10:14
1<CR>2<CR>3 Fizz<CR>4<CR>5 Buzz<CR>6 Fizz<CR>7<CR>8<CR>9 Fizz<CR>10 Buzz<CR>11<CR>12 Fizz<CR>13<CR>14<CR>15 FizzBuzz<CR>16<CR>17<CR>18 Fizz<CR>19<CR>20 Buzz<CR>21 Fizz<CR>22<CR>23<CR>24 Fizz<CR>25 Buzz<CR>26<CR>27 Fizz<CR>28<CR>29<CR>30 FizzBuzz<CR>31<CR>32<CR>33 Fizz<CR>34<CR>35 Buzz<CR>36 Fizz<CR>37<CR>38<CR>39 Fizz<CR>40 Buzz<CR>41<CR>42 Fizz<CR>43<CR>44<CR>45 FizzBuzz<CR>46<CR>47<CR>48 Fizz<CR>49<CR>50 Buzz<CR>51 Fizz<CR>52<CR>53<CR>54 Fizz<CR>55 Buzz<CR>56<CR>57 Fizz<CR>58<CR>59<CR>60 FizzBuzz<CR>61<CR>62<CR>63 Fizz<CR>64<CR>65 Buzz<CR>66 Fizz<CR>67<CR>68<CR>69 Fizz<CR>70 Buzz<CR>71<CR>72 Fizz<CR>73<CR>74<CR>75 FizzBuzz<CR>76<CR>77<CR>78 Fizz<CR>79<CR>80 Buzz<CR>81 Fizz<CR>82<CR>83<CR>84 Fizz<CR>85 Buzz<CR>86<CR>87 Fizz<CR>88<CR>89<CR>90 FizzBuzz<CR>91<CR>92<CR>93 Fizz<CR>94<CR>95 Buzz<CR>96 Fizz<CR>97<CR>98<CR>99 Fizz<CR>100 Buzzi1<CR>2<CR>3 Fizz<CR>4<CR>5 Buzz<CR>6 Fizz<CR>7<CR>8<CR>9 Fizz<CR>10 Buzz<CR>11<CR>12 Fizz<CR>13<CR>14<CR>15 FizzBuzz<CR>16<CR>17<CR>18 Fizz<CR>19<CR>20 Buzz<CR>21 Fizz<CR>22<CR>23<CR>24 Fizz<CR>25 Buzz<CR>26<CR>27 Fizz<CR>28<CR>29<CR>30 FizzBuzz<CR>31<CR>32<CR>33 Fizz<CR>34<CR>35 Buzz<CR>36 Fizz<CR>37<CR>38<CR>39 Fizz<CR>40 Buzz<CR>41<CR>42 Fizz<CR>43<CR>44<CR>45 FizzBuzz<CR>46<CR>47<CR>48 Fizz<CR>49<CR>50 Buzz<CR>51 Fizz<CR>52<CR>53<CR>54 Fizz<CR>55 Buzz<CR>56<CR>57 Fizz<CR>58<CR>59<CR>60 FizzBuzz<CR>61<CR>62<CR>63 Fizz<CR>64<CR>65 Buzz<CR>66 Fizz<CR>67<CR>68<CR>69 Fizz<CR>70 Buzz<CR>71<CR>72 Fizz<CR>73<CR>74<CR>75 FizzBuzz<CR>76<CR>77<CR>78 Fizz<CR>79<CR>80 Buzz<CR>81 Fizz<CR>82<CR>83<CR>84 Fizz<CR>85 Buzz<CR>86<CR>87 Fizz<CR>88<CR>89<CR>90 FizzBuzz<CR>91<CR>92<CR>93 Fizz<CR>94<CR>95 Buzz<CR>96 Fizz<CR>97<CR>98<CR>99 Fizz<CR>100 Buzz<Esc>:wq<CR>

0 comments


Created by: JordanALewis

150 active golfers, 511 entries

Leaderboard (lowest score wins):
39
#1 - Urtica dioica / udioica

03/09/2016 at 09:20AM

39
#2 - tbodt / tblodt

03/09/2016 at 10:23PM

39
#3 - Hao Chen / Chen_Hao

03/10/2016 at 12:33PM

39
#4 - Turkey Man / lvturkeyman

11/26/2017 at 11:49AM

43
#5 - John Braxler / braxler

10/14/2015 at 04:35PM

46
#6 - Jimmy Mabey / mabeyj

01/22/2013 at 02:38AM

46
#7 - xavier kt / xav_kt

02/03/2013 at 06:45PM

47
#8 - Conner McDaniel / connermcd

09/18/2012 at 08:18PM

47
#9 - Peeby Thirtyone / peeby31

05/10/2014 at 11:26AM

47
#10 - eban / eban

02/14/2017 at 07:40AM

48
#11 - Kerson Hsiao / KersonHsiao

08/16/2012 at 03:31AM

49
#12 - You-Siang Lin / yslinnctu

11/29/2011 at 11:30AM

49
#13 - Federico Galassi / federicogalassi

12/17/2011 at 01:15AM

49
#14 - Renat Aksitov / Korvin79

02/23/2012 at 06:29AM

49
#15 - Ravil Bayramgalin / brainopia

03/18/2012 at 04:03AM

49
#16 - Rod Knowlton / codelahoma

05/27/2012 at 12:25AM

49
#17 - Vim rocks / vimrocks

10/06/2012 at 03:34PM

49
#18 - Chris Patuzzo / cpatuzzo

11/03/2012 at 10:51PM

49
#19 - Trevor Powell / DoomedBunnies

05/14/2013 at 07:28AM

49
#20 - Petro Тrouq / zulolosi

06/04/2013 at 10:05PM

49
#21 - Steve Tjoa / stevetjoa

07/30/2013 at 05:59PM

49
#22 - pftb12345 / pftb12345

04/25/2015 at 08:58AM

49
#23 - Trey Thomas / treythomas123

03/10/2016 at 06:24AM

49
#24 - Dimitar Dimitrov / kurkale6ka

03/10/2016 at 03:58PM

49
#25 - Josh Callender / Saponifi3d

10/28/2016 at 05:59AM

50
#26 - Pete Johns / johnsyweb

01/17/2011 at 09:19AM

50
#27 - Wei Dai / clvv42

01/18/2011 at 02:13AM

50
#28 - Stephen Morrow / yawmark

01/26/2011 at 09:01PM

50
#29 - Justin Love / wondible

06/11/2011 at 12:46PM

50
#30 - Hu Junfeng / junfeng

07/16/2011 at 06:07AM