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 181 remaining solutions by signing in and submitting your own entry
#182 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

182 active golfers, 802 entries

Leaderboard (lowest score wins):
35
#91 - Jerry Yang / @efJerryYang

10/31/2025 at 12:12AM

35
#92 - mohaoz / @mohaoz

11/08/2025 at 02:43PM

35
#93 - Iuro Nascimento / @iurobpn

11/11/2025 at 07:31PM

35
#94 - matthi711 / @matthi711

11/25/2025 at 04:31PM

35
#95 - 8ecna / @8ecna

11/27/2025 at 12:19PM

35
#96 - Liimurr / @Liimurr

12/14/2025 at 10:34PM

35
#97 - Daniel / @2phost

01/11/2026 at 03:46PM

35
#98 - Pedro Belin Castellucci / @pedrocastellucci

01/16/2026 at 09:52PM

36
#99 - lichuantan / @lichuantan

01/02/2026 at 02:34PM

36
#100 - Omer Vishlitzky / @omer-vishlitzky

01/07/2026 at 11:19PM

37
#101 - sealldev / @sealldeveloper

08/04/2025 at 02:10AM

37
#102 - lovebigwei / @lovebigwei

10/13/2025 at 02:24AM

37
#103 - Richard O'Brien / @robrien-bcgov

12/05/2025 at 04:32PM

37
#104 - Seagull2004 / @Seagull2004

12/11/2025 at 10:40AM

38
#105 - Dan Brackenbury / @helpvisa

07/30/2025 at 04:10AM

38
#106 - Noitidart / @Noitidart

08/03/2025 at 02:54AM

38
#107 - db-fodor / @db-fodor

10/16/2025 at 01:48PM

38
#108 - M S Dheeraj Murthy / @Dheeraj-Murthy

01/15/2026 at 12:27PM

39
#109 - TWiZTeD22 / @TWiZTeD22

07/18/2025 at 07:38AM

39
#110 - MarkSverdlov / @MarkSverdlov

07/28/2025 at 06:35PM

39
#111 - Matthew Cooper / @mkcmkc

08/18/2025 at 01:43AM

39
#112 - phaym / @phaym

10/11/2025 at 01:31PM

39
#113 - wsulcs / @wsulcs

10/19/2025 at 07:31PM

39
#114 - é / @queuefactor

11/10/2025 at 09:43PM

39
#115 - EthanMcGuire / @EthanMcGuire

01/03/2026 at 05:19PM

39
#116 - Caleb Abrams / @kingcabrams

01/06/2026 at 06:06PM

40
#117 - Karan / @KaranVaity

08/16/2025 at 08:44AM

40
#118 - djheidihoe / @djheidihoe1

10/14/2025 at 08:10PM

40
#119 - Tyler Patton / @jamestylerpatton

11/19/2025 at 11:21PM

40
#120 - JohanIsaksson / @JohanIsaksson

11/28/2025 at 11:59AM