You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it's beneficial to have a thread where we can share how the helix motions can be used in practical applications to refactor code. Feel free to share yours here, if I have any cool ones in mind I'll also add a comment.
I'll start
Converting the following object into an array of tuples, each tuple's first element is the color name and the second is the color value
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I think it's beneficial to have a thread where we can share how the helix motions can be used in practical applications to refactor code. Feel free to share yours here, if I have any cool ones in mind I'll also add a comment.
I'll start
Converting the following object into an array of tuples, each tuple's first element is the color name and the second is the color value
mr{[
to replace surrounding curly braces with square bracketsmi[
to select everything within the arrays
to enter select mode:<enter>
to place a cursor on every:
characterr,
to replace every:
with a,
(comma)t,;
to move cursor on each line to the ending comma, the semicolon collapses all selections to a single cursorvgs
to make a selection on each line from the beginning (excluding whitespace) up until, but excluding the commams[
to surround with square brackets (array)l
to move 1 character forwarde
to select until the end of each wordms"
to surround the items with double quotes to make stringsComplete command:
mr{[mi[s:<enter>r,t,;vgsms[lems"
Output:
Beta Was this translation helpful? Give feedback.
All reactions