How can I convert tabs to spaces and vice versa in an existing file

Zach Lysobey picture Zach Lysobey · Nov 28, 2015 · Viewed 78.4k times · Source

I cannot figure out how to do this for the life of me apart from doing a find-replace on 4 spaces and converting to tabs (Version 0.10.2). I can't think of an editor/IDE that doesn't have a specific feature to do this. Does VSCode?

Answer

Peter Butkovic picture Peter Butkovic · May 29, 2016

Since fix of: https://github.com/Microsoft/vscode/issues/1228 the editor supports it out of the box. Simply go for:

  1. F1,
  2. indentationToSpaces or indentationToTabs (depending on your need)
  3. Enter.