How can I change the tab size of all my written VS Code?

I have started working with someone else on VS Code and they are using a tab size of 4 while I use 2. I have changed mine to 4 as well now but my already written code has a tab size of 2 but I would like to change all of it to 4 without manually go through all the code.

Is there an easy way to do this?

Upvotes: 0

Views: 4610

Answers (3)

Sunil
Sunil

Reputation: 37

The solution for your problem is very simple just

Press Ctrl+F in vs-code and

Then in the find section type \t then

In the replace section type \t\t

Upvotes: 0

Aubrey Rose
Aubrey Rose

Reputation: 11

I know this is old but I thought I'd add this incase someone else ran into this issue. This is how I did it

  1. Go into settings and make sure your "Editor: Tab Size" is set to your original tab size (in your case 2)
  2. Go to the file you want to convert. Open the command pallet, and run "Convert Indentation to Tabs" (Do this for all files you want to convert)
  3. Go back to settings and change "Editor: Tab Size" to the new tab size (in your case 4)
  4. Go back to the file you want to convert. Open the command pallet, and run "Convert Indentation to Spaces" (Do this for all files you want to convert)

Upvotes: 0

Kazi Monirul Islam
Kazi Monirul Islam

Reputation: 25

You can select all the code and press tab manually of what tab size you want.

Upvotes: 0

Related Questions