-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Comments
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. |
I agree with @Tyriar. |
+1 that this is should be done in an extension. Keeping open as a help wanted, feature request. |
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! |
Looks like there are a couple of extensions that do this. |
@xeoneux I agree, this should be on the core editor. |
+1 (I m currently copy pasting tabs) |
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. |
+1 |
+1 for this feature built into vscode |
+1 |
1 similar comment
+1 |
Things like tab/space and line ending conversion is really a core editor feature in my mind. |
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. |
@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. |
+1 When opening "foreign" files a simple core option would be much better than ext replace or beeing forced to install an extension |
👍 |
+1 |
+1 I use Untabify but agree that this should be a core feature. |
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. |
+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. |
+1 |
Fixed by f01ee98 |
@isidorn Thank you sir! :) Cheers, |
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
The text was updated successfully, but these errors were encountered: