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

Assignment Alignment

line up the operators. Use spaces, not tabs.

Start file
# Align these assignments

x = 1
y = true
z = 'you'
foo = 'bar'
long_name = "long variable value"
$p3cial = ch4rs
last = line

# Much better!
End file
# Align these assignments

x         = 1
y         = true
z         = 'you'
foo       = 'bar'
long_name = "long variable value"
$p3cial   = ch4rs
last      = line

# Much better!

View Diff

3,6c3,6
< x = 1
< y = true
< z = 'you'
< foo = 'bar'
---
> x         = 1
> y         = true
> z         = 'you'
> foo       = 'bar'
8,9c8,9
< $p3cial = ch4rs
< last = line
---
> $p3cial   = ch4rs
> last      = line

Solutions by @shahanavazm:

Unlock 9 remaining solutions by signing in and submitting your own entry
Created by: @khamer

220 active golfers, 883 entries

Solutions by @shahanavazm:
20
#90 - shahanavaz m / @shahanavazm

03/09/2024 at 12:23AM

22
#>103 - shahanavaz m / @shahanavazm

02/01/2024 at 06:33PM

35
#>196 - shahanavaz m / @shahanavazm

03/09/2024 at 12:17AM

36
#>201 - shahanavaz m / @shahanavazm

03/08/2024 at 07:08PM

36
#>201 - shahanavaz m / @shahanavazm

03/30/2024 at 06:42PM

38
#>202 - shahanavaz m / @shahanavazm

02/20/2022 at 12:58AM

38
#>202 - shahanavaz m / @shahanavazm

04/06/2024 at 03:02AM

39
#>203 - shahanavaz m / @shahanavazm

03/30/2024 at 06:34PM

46
#>208 - shahanavaz m / @shahanavazm

03/24/2024 at 12:57AM