Search code examples
visual-studio-codevscode-debuggervscode-tasks

what's the VScode shortcut for breaking words of a Horizontal line?


is there a shortcut of vscode editor to turn line from horizental to vertical ,convert this :

<View style={{flex:1,marginTop:20, paddingHoizental : 20, backgroundColor : '#FFF'}}>

into this

<View 
style={{flex:1,
marginTop:20, 
paddingHoizental : 20,
backgroundColor : '#FFF'}}>

Solution

    • Select the first comma.
    • Press CtrlD several times to select all commas.
    • Press to unselect the commas, and put a cursor after each one.
    • Finally, press Enter.

    This results in:

    <View 
    style={{flex:1,
    marginTop:20,
     paddingHoizental : 20,
     backgroundColor : '#FFF'}}>
    

    If you didn't have inconsistent spaces after commas, it would align properly. Then you could select both the comma and the following space (if any).