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
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 219 remaining solutions by signing in and submitting your own entry
#220 personlink / @personlink - Score: 363 - 04/07/11 @ 08:56
Vjjjjjjjjjjjjjjjjyppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp<Esc>dddxxxxxxxxxxxxxxixxxxxx<Esc>GGVggdi# Align these assignments<CR><CR>x = 1<CR>y = true<CR>z = 'you'<CR>foo = 'bar'<CR>long_name = "long variable value"<CR>$p3cial = ch4rs<CR>last = line<CR><CR># Much better!<Esc>:wq<CR>
0 comments