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 5f0890dbb409320009a38274

Multiline to Single Line

Convert a multiline, indented file to a single line with no whitespace

Start file
api(
   
'com.vimgolf.challenge'
)
End file
api('com.vimgolf.challenge')

View Diff

1,3c1
< api(
<     'com.vimgolf.challenge'
< )
---
> api('com.vimgolf.challenge')

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 310 remaining solutions by signing in and submitting your own entry
#311 HamzaOPLEX / @HamzaOplex - Score: 100 - 05/12/21 @ 22:43
:<C-B><C-V><C-V><BS><50-53>:%s/\%>'(\s*\%<')// | :%s/\%>'(\n\%<')//<Esc>[201~<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><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><BS><CR>:q<CR>:wq<CR>

0 comments


Created by: @IsaacPZZ

311 active golfers, 735 entries

Leaderboard (lowest score wins):
6
#271 - tgYun783 / @tgYun783

04/08/2024 at 11:10AM

6
#272 - im sung / @imsung751775

04/10/2024 at 07:07AM

6
#273 - lazely / @lazely

04/14/2024 at 07:47AM

6
#274 - kanguk123 / @kanguk123

03/30/2025 at 03:31PM

6
#275 - godjun123 / @godjun123

03/31/2025 at 07:45AM

6
#276 - woozhin / @woozhin

04/01/2025 at 10:41AM

7
#277 - Miki Tebeka / @tebeka

07/16/2020 at 06:37AM

7
#278 - Norman Liu / @normanwliu

07/25/2020 at 10:57PM

7
#279 - Lorenz Leitner / @LorenzLeitner

07/26/2020 at 01:22PM

7
#280 - Martin Kauppinen / @MartinKauppinen

08/15/2020 at 05:47PM

7
#281 - Michael D Jones / @biotechjones

09/02/2020 at 08:00PM

7
#282 - JP / @JP16366170

09/08/2020 at 02:30PM

7
#283 - :wq / @write_quit_22

05/19/2021 at 06:40PM

7
#284 - merphant / @merphant

11/18/2021 at 07:52AM

7
#285 - Nikita Bobko / @nikitabobko

01/13/2022 at 12:53AM

7
#286 - Vincent / @Vincent49015451

01/28/2022 at 01:03PM

7
#287 - 황시준_2771 / @ilPp5j1wfhKSFHr

04/04/2022 at 01:15AM

7
#288 - محمد محمود / @Mo__Saleh_

04/27/2022 at 12:03AM

7
#289 - 권민재 / @gommj0611

04/07/2023 at 07:59AM

7
#290 - かみひろ / @km_hr

03/03/2024 at 05:13AM

8
#291 - Anil Narayan / @AnilNarayan2013

07/23/2020 at 01:34AM

8
#292 - Sam Clark / @samrocksc

02/16/2022 at 01:35PM

9
#293 - Danko Miocevic / @DankoMiocevic

09/17/2021 at 08:21PM

9
#294 - jackson / @bearahuman

04/18/2023 at 03:26PM

9
#295 - HYoMo-nim / @HYoMo-nim

03/28/2025 at 04:16PM

9
#296 - ishj00 / @ishj00

04/01/2025 at 02:00PM

9
#297 - kimbadaa / @kimbadaa

04/02/2025 at 02:41PM

11
#298 - blue christ / @bluechrist3

08/01/2020 at 09:20PM

13
#299 - William Ott / @oddalot

07/12/2020 at 11:42PM

13
#300 - fff / @fff51460170

02/21/2021 at 04:30AM