Restructuring a YAML or JSON File in VSCode
How to do tab and shift tab to move a block of code ?
Hey everyone! Last week, I had to restructure a massive Kubernetes .yml file for a Spinnaker pipeline. Imagine a YAML file with thousands of lines, where some parts were messy, and many were not properly aligned. If I tried to fix it line by line, I’d probably lose my sanity. 😵💫
But don’t worry—there’s a shortcut that can save the day! If you’re using VS Code (or similar editors), you can easily align and clean up your YAML file in just a few keystrokes. Here's how:
The Shortcut
Step-1: Highlight the messy lines.
Step-2: Use Shift + Tab to align to the left
or Use Tab to align to the right.
Before it was like so :(
As you see the Magic is working :)
Good luck and please lets share our knowledge with each others.
See you in next post !








It is simple tips but very useful for many developers I guess.