Home > Back-end >  what's the VScode shortcut for breaking words of a Horizontal line?
what's the VScode shortcut for breaking words of a Horizontal line?

Time:06-26

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'}}>

CodePudding user response:

  • 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).

  • Related