Reverse Golf Example
Switch the "Before" and "After" cases for a Helix Golf example.
Before
# snake_case to camelCase
Rename all fields to be camelCase.
## Before
```js
const user_profile = {first_name: "John"};
```
## After
```js
const userProfile = {firstName: "John"};
```
After
# camelCase to snake_case
Rename all fields to be snake_case.
## Before
```js
const userProfile = {firstName: "John"};
```
## After
```js
const user_profile = {first_name: "John"};
```
Preview
Command
ebyxb*Rv""Nn<alt-)>
%s`+j<enter>f;<alt-(>
ebselects the next word and trims whitespaceycopies the selected word and yanks it into the " (double quote) registerxbselects the last word in the line*sets the current selection as the search patternRreplaces the selected word with the copied selection from earlierventers select mode""selects the " (double quote) register. PressingNwill add a new selection at the previous occurrence of the word saved to the registernadds a new selection at the next occurrence of the search pattern assigned earlier<alt-)>rotates the contents of the selections forward%selects the entire contents of the filesbrings up a prompt to select sub-selections by a given regex. We type in`+jfor the regex and select all matches with<enter>- Since we're still in select mode, typing
f;moves each cursor to select up until (and including) the next occurrence of a semicolon <alt-(>rotates the contents of the selections backwards