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):
40
#181 - JohanIsaksson / @JohanIsaksson

11/28/2025 at 11:59AM

40
#182 - Marcin Szmagara / @marcin-szmagara

12/15/2025 at 08:42PM

40
#183 - Kevin Zhang / @midgramr

12/22/2025 at 11:16PM

40
#184 - lassion / @mutilator630

01/12/2026 at 07:18PM

40
#185 - RomeoV / @RomeoV

01/14/2026 at 10:41PM

40
#186 - pedro / @pepedro12

01/16/2026 at 06:32PM

40
#187 - André Cerqueira / @Cryptic4Life

02/09/2026 at 04:09PM

40
#188 - lemonish / @p-lemonish

04/19/2026 at 06:53PM

40
#189 - Delta Null / @Null-Delta

05/28/2026 at 03:26PM

40
#190 - William Grant Mayer / @wgmayer0

06/10/2026 at 03:38PM

40
#191 - mtwilki / @mtwilki

07/10/2026 at 08:17PM

41
#192 - ♜ Pepe Doval / @pepellou

08/14/2025 at 07:12PM

41
#193 - LolPopGames / @LolPopGames

09/30/2025 at 08:50PM

41
#194 - Martijn / @martijnf1

10/18/2025 at 07:55PM

41
#195 - Rafe Murray / @rafe-murray

01/15/2026 at 08:17PM

41
#196 - Kasper Kivimäki / @KasperKivimaeki

05/22/2026 at 01:46PM

41
#197 - Jason Crosthwaite / @jasoncros

09/09/2026 at 03:34PM

42
#198 - Jonathan Cooper / @ReallySnazzy

07/04/2025 at 04:46AM

42
#199 - Hunter Elbourn / @HunterEl

08/21/2025 at 08:11PM

42
#200 - Autistic-Cookie / @Autistic-Cookie

08/27/2025 at 08:18PM

42
#201 - JosiahBLB / @JosiahBLB

09/02/2025 at 04:10AM

42
#202 - Alberto López Rodríguez / @albertolr98

10/20/2025 at 09:23AM

42
#203 - Mathis Rabouille / @MathisRabouille

10/23/2025 at 08:53AM

42
#204 - Robert Polski / @RMpolski

11/03/2025 at 05:23AM

42
#205 - Ylli / @FazlijaYlli

11/05/2025 at 08:51AM

42
#206 - coxxny / @coxxny

11/07/2025 at 02:33PM

42
#207 - tphLatte / @tphLatte

11/25/2025 at 02:02AM

42
#208 - Crazed-Engineer / @Crazed-Engineer

11/30/2025 at 06:59PM

42
#209 - Atharva / @servearv

12/22/2025 at 07:57AM

42
#210 - Martin Eisemann / @martineisemann

01/03/2026 at 08:33PM