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 175 remaining solutions by signing in and submitting your own entry
#176 Priyanshu Katuwal / @priyanshulxiv - Score: 114 - 12/05/25 @ 03:26
dd:%s/\(\w\+\)\[\(.*\)]\[\(.*\)]\[\(.*\)]-\(\w\+\)\[\(.*\)]\[\(.*\)\<BS>]\[\(.*\)]/\1(\2, \3, \4)-\5(\6, \7, \8)<CR>:wq<CR>

0 comments


Created by: @mirroris

176 active golfers, 782 entries

Leaderboard (lowest score wins):
24
#1 - coreder0704 / @coreder0704

11/08/2025 at 04:17PM

24
#2 - Gavin / @GavinKoeng

12/09/2025 at 02:50AM

25
#3 - Peppa Pig / @PeppaPigSg

07/05/2025 at 08:17AM

25
#4 - ZEraX4 / @ZEraX4

07/05/2025 at 09:51AM

25
#5 - Paul Yates / @PYates77

07/07/2025 at 08:36PM

25
#6 - Drake Brown / @brownthesr

07/20/2025 at 03:31PM

25
#7 - EvenAnton / @EvenAnton

07/28/2025 at 10:40AM

25
#8 - Kelvinauta / @kelvinauta

07/28/2025 at 11:42PM

25
#9 - ThisMlingen / @ThisMlingen

07/31/2025 at 04:08AM

25
#10 - daviddcox / @daviddcox

07/31/2025 at 04:08AM

25
#11 - imaicpp1983 / @imaicpp1983

08/03/2025 at 10:03AM

25
#12 - Kurt Preston / @worldhello

08/06/2025 at 12:35PM

25
#13 - Gigo / @GiggioG

08/07/2025 at 11:14AM

25
#14 - TheTaoOfSu / @TheTaoOfSu

08/07/2025 at 07:44PM

25
#15 - Julius Degesys / @JuliusDegesys

08/15/2025 at 09:07PM

25
#16 - JoshHughes156 / @JoshHughes156

08/22/2025 at 12:03AM

25
#17 - dnzc / @dnzc

08/28/2025 at 06:35PM

25
#18 - Vsevolod Rychkov / @MadPigeon

09/04/2025 at 11:37AM

25
#19 - jimmymills / @jimmymills

09/10/2025 at 05:06AM

25
#20 - Danilo J. S. Bellini 🥊🇧🇷 / @danilobellini

09/10/2025 at 07:26AM

25
#21 - Nathan / @NathanSnail

09/20/2025 at 03:27AM

25
#22 - mustache-enthusiast / @mustache-enthusiast

09/30/2025 at 05:21PM

25
#23 - Ludovic Schwartz / @ludovicschwartz

10/02/2025 at 02:57PM

25
#24 - SmileImagine / @SmileImagine

10/05/2025 at 04:19AM

25
#25 - ProGamerYeet / @ProGamerYeet

10/06/2025 at 07:24PM

25
#26 - Saneladam / @Saneladam

10/08/2025 at 08:34AM

25
#27 - Matthew Berthoud / @Matthew-Berthoud

10/08/2025 at 01:55PM

25
#28 - Raven-tale / @Raven-tale

11/09/2025 at 05:35AM

25
#29 - Bruno Vetter / @simplelife2010

11/13/2025 at 07:34AM

25
#30 - Aly Thobani / @alythobani

11/14/2025 at 07:19PM