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 9v00686695ea000000000723

From brakets to parens

This is one of the most common problem when you wrap an array for error handling. Vim is useful when you convert foo[i][j][k] into foo(i, j, k) for many times.

Start file
int main() {
	glm::vec3 umax(
		(vx[i+1][j][k]-vx[i][j][k])/2,
		(vy[i][j+1][k]-vy[i-1][j+1][k])/2,
		(vz[i][j][k+1]-vz[i-1][j][k+1])/2
	);
	glm::vec3 umin(
		(m_vx[i][j][k]-m_vx[i-1][j][k])/2,
		(m_vy[i][j][k]-m_vy[i-1][j][k])/2,
		(m_vz[i][j][k]-m_vz[i-1][j][k])/2
	);
}
End file
int main() {
	glm::vec3 umax(
		(vx(i+1, j, k)-vx(i, j, k))/2,
		(vy(i, j+1, k)-vy(i-1, j+1, k))/2,
		(vz(i, j, k+1)-vz(i-1, j, k+1))/2
	);
	glm::vec3 umin(
		(m_vx(i, j, k)-m_vx(i-1, j, k))/2,
		(m_vy(i, j, k)-m_vy(i-1, j, k))/2,
		(m_vz(i, j, k)-m_vz(i-1, j, k))/2
	);
}

View Diff

1d0
< 
4,6c3,5
< 		(vx[i+1][j][k]-vx[i][j][k])/2,
< 		(vy[i][j+1][k]-vy[i-1][j+1][k])/2,
< 		(vz[i][j][k+1]-vz[i-1][j][k+1])/2
---
> 		(vx(i+1, j, k)-vx(i, j, k))/2,
> 		(vy(i, j+1, k)-vy(i-1, j+1, k))/2,
> 		(vz(i, j, k+1)-vz(i-1, j, k+1))/2
9,11c8,10
< 		(m_vx[i][j][k]-m_vx[i-1][j][k])/2,
< 		(m_vy[i][j][k]-m_vy[i-1][j][k])/2,
< 		(m_vz[i][j][k]-m_vz[i-1][j][k])/2
---
> 		(m_vx(i, j, k)-m_vx(i-1, j, k))/2,
> 		(m_vy(i, j, k)-m_vy(i-1, j, k))/2,
> 		(m_vz(i, j, k)-m_vz(i-1, j, k))/2
13c12
< }
\ No newline at end of file
---
> }

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 293 remaining solutions by signing in and submitting your own entry
#294 DuffyPoo / @DuffyPoo - Score: 560 - 01/23/26 @ 16:38
jjjklllllllllllljxi(<Esc>llllxxi, <Esc>llxxi, <Esc>llxi)<Esc>llllxi(<Esc>lllhxxi, <Esc>llxxi, <Esc>llxi)<Esc>jhhhhhhhhhhhhhhhhhhhhhhxi(<Esc>llxxi, <Esc>llllxxi, <Esc>llxi)x<BS><Esc>llllxi(<Esc>llllxxi, <Esc>llllxxi, <Esc>llxii<BS>)<Esc>jhhhhhhhhhhhhhhhhhhhhhhhhhhxi(<Esc>llxxx<Esc>ui, <Esc>llxxi, <Esc>llllxi)<Esc>llllxi(<Esc>llllxxi, <Esc>llxxi, <Esc>llllxi)<Esc>jjjhhhhhhhhhhhhhhhhhhhhhhhhhlxi(x<BS><Esc>llxxi, <Esc>llxxi, <Esc>llxi)<Esc><Esc>llllllxi(<Esc>llllxxi, <Esc>lllhxxi, <Esc>llxi)<Esc>jhhhhhhhhhhhhhhhhhhhhhhhhxi(<Esc>llxxi, <Esc>llxxi, <Esc>llxi)<Esc>llllllxi(<Esc>llllxxi<<BS>, <Esc>llxxi, <Esc>llxi)<Esc>jjkkhhhhhhhhhhhhhhhhhhhhhhhhjxi(<Esc>llxxi, <Esc>llxxi, <Esc>lllhxi,<BS>)<Esc>llllllxi(<Esc>llllxxi, <Esc>llxxi, <Esc>lllhxi)<Esc>kkkkkkkkkkkkkkkkkkddjl:wq<CR>

0 comments


Created by: @mirroris

294 active golfers, 1302 entries

Leaderboard (lowest score wins):
27
#91 - lairdstewart / @lairdstewart

07/15/2025 at 02:03AM

27
#92 - Mikhail Lavrentiev / @lavrentievms

01/07/2026 at 09:34PM

27
#93 - DeltaJay / @DeltaJay

06/07/2026 at 11:36PM

27
#94 - DJ Chateau / @djchateau

06/09/2026 at 12:05PM

27
#95 - Joshu Coats / @rhwlo

07/05/2026 at 10:08PM

28
#96 - Maximilian Ballard / @ediw8311xht

07/04/2025 at 09:00PM

28
#97 - Mostafa Kashwaa / @MostafaKashwaa

07/10/2025 at 07:14AM

28
#98 - Zach McKenna / @zcmckenna

07/10/2025 at 01:00PM

28
#99 - Håkon Anders Strømsodd / @haakon8855

08/13/2025 at 02:17PM

28
#100 - qoober1 / @qoober1

04/04/2026 at 02:34PM

28
#101 - RedstoneRepeater / @RedstoneRepeater

04/26/2026 at 04:06AM

28
#102 - Jess Price / @JRPrice5

04/27/2026 at 03:31PM

29
#103 - Ozan / @OzanY4

07/16/2025 at 08:43PM

29
#104 - Sean / @MrSean2d2

03/24/2026 at 04:20AM

30
#105 - Ming / @x51ming

07/10/2025 at 11:11AM

30
#106 - gwrhyr / @gwrhyr

02/21/2026 at 09:28AM

30
#107 - chenzuyu1-star / @chenzuyu1-star

06/09/2026 at 07:50PM

31
#108 - LunaSakura / @Luna5akura

11/13/2025 at 08:24AM

31
#109 - Stanislav Kuzmin / @skntxtrd

04/12/2026 at 05:52PM

32
#110 - Martin Harvan / @martinhrvn

10/31/2025 at 09:07PM

32
#111 - yit6 / @yit6

07/02/2026 at 04:56PM

33
#112 - mintonofall / @mintonofall

12/30/2025 at 05:15AM

33
#113 - Lawrence Zahner / @schmurda

05/28/2026 at 01:18AM

34
#114 - Bthxtly / @Bthxtly

07/15/2025 at 08:13AM

34
#115 - Benjamin / @b2vqbw

07/16/2025 at 02:47AM

34
#116 - Isaac Salzman / @Czensored

07/17/2025 at 09:18AM

34
#117 - eastaveracruz / @eastaveracruz

11/05/2025 at 04:58PM

34
#118 - Sjur B. / @Apostrophel

12/15/2025 at 01:12PM

34
#119 - shooker2012 / @shooker2012

01/06/2026 at 03:07AM

34
#120 - Purple-Chicken / @Purple-Chicken

01/23/2026 at 04:37AM