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 4fe62f8a8b2f800001000043

Cleanining up 80 column concatenated text

1. Put the whole query on one line, remove the concatenation operators 2. Remove the double spaces that appear a few times in the query 3. Use string-interpolated variable statementPid rather than the ugly concatenation

Start file
$atres = sqlStatement("select f.name,f.street,f.city,f.state,f.postal_code from facility f " .
  " left join users u on f.id=u.facility_id " .
  " left join  billing b on b.provider_id=u.id and b.pid = '".$stmt['pid']."' " .
  " where  service_location=1");
$row = sqlFetchArray($atres);
End file
$atres = sqlStatement("select f.name,f.street,f.city,f.state,f.postal_code from facility f left join users u on f.id=u.facility_id left join billing b on b.provider_id=u.id and b.pid = $statementPid where service_location=1");
$row = sqlFetchArray($atres);

View Diff

1,4c1
< $atres = sqlStatement("select f.name,f.street,f.city,f.state,f.postal_code from facility f " .
<   " left join users u on f.id=u.facility_id " .
<   " left join  billing b on b.provider_id=u.id and b.pid = '".$stmt['pid']."' " .
<   " where  service_location=1");
---
> $atres = sqlStatement("select f.name,f.street,f.city,f.state,f.postal_code from facility f left join users u on f.id=u.facility_id left join billing b on b.provider_id=u.id and b.pid = $statementPid where service_location=1");

Solutions by @GavinKoeng:

Unlock 22 remaining solutions by signing in and submitting your own entry
Created by: @Salshammath

82 active golfers, 229 entries

Solutions by @GavinKoeng:
31
#11 - Gavin / @GavinKoeng

06/27/2026 at 02:21AM

32
#>15 - Gavin / @GavinKoeng

06/27/2026 at 02:20AM

33
#>29 - Gavin / @GavinKoeng

06/27/2026 at 02:20AM

34
#>30 - Gavin / @GavinKoeng

06/27/2026 at 02:20AM

35
#>32 - Gavin / @GavinKoeng

06/27/2026 at 02:19AM

38
#>35 - Gavin / @GavinKoeng

06/27/2026 at 02:19AM

39
#>37 - Gavin / @GavinKoeng

06/27/2026 at 02:18AM

41
#>39 - Gavin / @GavinKoeng

06/27/2026 at 02:18AM

42
#>43 - Gavin / @GavinKoeng

06/27/2026 at 02:17AM

43
#>44 - Gavin / @GavinKoeng

06/27/2026 at 02:17AM

44
#>50 - Gavin / @GavinKoeng

06/27/2026 at 02:16AM

45
#>52 - Gavin / @GavinKoeng

06/27/2026 at 02:16AM

46
#>53 - Gavin / @GavinKoeng

06/27/2026 at 02:16AM

47
#>56 - Gavin / @GavinKoeng

06/27/2026 at 02:15AM

48
#>63 - Gavin / @GavinKoeng

06/27/2026 at 02:15AM

49
#>65 - Gavin / @GavinKoeng

06/27/2026 at 02:14AM

50
#>68 - Gavin / @GavinKoeng

06/27/2026 at 02:13AM

52
#>69 - Gavin / @GavinKoeng

06/27/2026 at 02:12AM

53
#>72 - Gavin / @GavinKoeng

06/27/2026 at 02:09AM

54
#>74 - Gavin / @GavinKoeng

06/27/2026 at 02:08AM

55
#>76 - Gavin / @GavinKoeng

06/27/2026 at 02:08AM

56
#>76 - Gavin / @GavinKoeng

06/27/2026 at 02:07AM