Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to convert tabs to spaces #1228

Closed
pcgeek86 opened this issue Dec 13, 2015 · 24 comments
Closed

Add option to convert tabs to spaces #1228

pcgeek86 opened this issue Dec 13, 2015 · 24 comments
Assignees
Labels
feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities verified Verification succeeded
Milestone

Comments

@pcgeek86
Copy link

Would it be possible to add a VS Code command to convert tabs to spaces, and vice versa?

I copied some JSON code from GitHub into VS Code, using Google Chrome, and it's indented using tabs. I'd like to convert it to use 2 spaces.

I searched for this issue on here, and couldn't find it. I only saw references to VS Code settings for using tabs or spaces by default.

Cheers,
Trevor Sullivan
Microsoft MVP: PowerShell

@Tyriar
Copy link
Member

Tyriar commented Dec 13, 2015

This can be fairly easily achieved using find and replace with regex. This sort of functionality would probably better be captured in an extension rather than the core editor.

@hashhar
Copy link
Contributor

hashhar commented Dec 13, 2015

I agree with @Tyriar.

@egamma egamma added feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities labels Dec 14, 2015
@egamma egamma added this to the Backlog milestone Dec 14, 2015
@egamma
Copy link
Member

egamma commented Dec 14, 2015

+1 that this is should be done in an extension. Keeping open as a help wanted, feature request.

@xeoneux
Copy link

xeoneux commented Dec 14, 2015

I do agree that this can be done via an extension, however, I strongly believe that a simple option to translate tabs to spaces or vice versa should be present as it increases the editor's usability a lot. The developer's focus would remain on the code rather than on fixing such trivial issues by searching for an extension. These convenient yet lightweight additions to the editor would make it really pleasing to use.

It was one of the features of Sublime Text that I clearly remember being handy when required!

Tabs to Spaces

@waderyan
Copy link

@suederade
Copy link

@xeoneux I agree, this should be on the core editor.

@bumpmann
Copy link

+1 (I m currently copy pasting tabs)

@andradei
Copy link

It can be an extension, sure. But VS Code already does so many neat things that ease development (like Git integration) which are extensions on other editors. This could easily be a built-in feature.

@warpdesign
Copy link
Contributor

+1

@gulshan
Copy link

gulshan commented Jan 28, 2016

+1 for this feature built into vscode

@jcurlier
Copy link

+1

1 similar comment
@perrich
Copy link

perrich commented Jan 28, 2016

+1

@evolutional
Copy link

Things like tab/space and line ending conversion is really a core editor feature in my mind.

@LittleBrainz
Copy link

The primary reason I switched from Atom to Code was that I would no longer need to install an extension for every little editor feature I used daily. To me, space / tab conversion is a fundamental code editing requirement that belongs in the core product.

@xeoneux
Copy link

xeoneux commented Jan 28, 2016

@LittleBrainz Exactly. Code provides a lot of functionality out of the box as compared to Atom and that was my reason for the switch too.

@cthedot
Copy link

cthedot commented Jan 28, 2016

+1

When opening "foreign" files a simple core option would be much better than ext replace or beeing forced to install an extension

@rakkarage
Copy link

👍
and spaces to tabs please

@fcrespo82
Copy link

+1

@allbitsnbytes
Copy link

+1

I use Untabify but agree that this should be a core feature.

@sandcastle
Copy link

There is an extension I created a while back that achieves this, it automatically updates files on save so if you touch the file it will normalize the whitespace.

@hworld
Copy link

hworld commented Jan 29, 2016

+1 Would love this as a core feature, as well. It's something I missed moving from Sublime an it helps a lot when copy/pasting code from other sources.

@joshy
Copy link

joshy commented Jan 29, 2016

+1
IMHO Tab<->Space conversion should be in core, like e.g. the awesome Markdown Preview (Crtl+Shilft+V) or git integration.

@egamma egamma mentioned this issue Feb 4, 2016
97 tasks
@isidorn isidorn self-assigned this Feb 16, 2016
@isidorn isidorn modified the milestones: Feb 2016, Backlog Feb 16, 2016
@joaomoreno joaomoreno mentioned this issue Feb 22, 2016
3 tasks
@isidorn
Copy link
Contributor

isidorn commented Feb 22, 2016

Fixed by f01ee98

@isidorn isidorn closed this as completed Feb 22, 2016
@pcgeek86
Copy link
Author

@isidorn Thank you sir! :)

Cheers,
Trevor Sullivan

@isidorn isidorn assigned alexdima and unassigned isidorn Feb 26, 2016
@alexdima alexdima added the verified Verification succeeded label Feb 26, 2016
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities verified Verification succeeded
Projects
None yet
Development

No branches or pull requests