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

Indent with TABS instead of SPACES by default #211836

Open
GrabbenD opened this issue May 2, 2024 · 2 comments
Open

Indent with TABS instead of SPACES by default #211836

GrabbenD opened this issue May 2, 2024 · 2 comments
Labels
editor-core Editor basic functionality feature-request Request for new features or functionality

Comments

@GrabbenD
Copy link

GrabbenD commented May 2, 2024

Visual Studio Code is extremely widespread.
Default settings have a great impact on how documents are structured worldwide.

Most people don't change this setting despite all the benefits:

  • Using tabs by default allows the user to set their own width preference which doesn't affect other users to e.g. save screen real-estate with low DPI laptop/screens.
  • One tab character per indentation level instead of 2 or 4 spaces will use less disk space / memory / compiler resources.
  • Indent Auto-detection doesn't work with 3 spaces. This wouldn't be a problem with Tabs, it'd yield quicker detection and reduce risk of wrong assumption about indentation size.
  • Historically tab is still the character specifically designed for indentation.

This is a low hanging fruit which has great benefits with no downsides 🙂

@GrabbenD
Copy link
Author

GrabbenD commented May 2, 2024

Workaround

This configuration works extremely well thus far:

  • It respects the format of the file you're viewing.
    • This is useful as tabs are preferred when programming / in code files (bonus: I've noticed Github properly adjusts the size for such files in the web-editor).
    • Prevents markdown / text documents from looking ugly (if opened externally with default editor/vim/nano or web-editor in Github). Check out Language specific settings and Language identifier.
  • Tab size 2 seems to be the sweet spot (especially for markdown, e.g. nested lists in places like Reddit/Github).
  • Existing files needs to be converted manually using Convert Indentation to Tabs via Status Bar (in right bottom corner).
# ~/.config/VSCodium/User/settings.json
"editor.insertSpaces": false,
"editor.tabSize": 2,
"editor.detectIndentation": true,
"editor.autoIndent": "full",
"[markdown][plaintext]": {
    "editor.insertSpaces": true
}

(Answers #22012)

@sandy081 sandy081 assigned alexdima and unassigned sandy081 May 3, 2024
@alexdima alexdima added feature-request Request for new features or functionality editor-core Editor basic functionality labels Jun 4, 2024
@alexdima alexdima removed their assignment Jun 4, 2024
@VSCodeTriageBot VSCodeTriageBot added this to the Backlog Candidates milestone Jun 4, 2024
@VSCodeTriageBot
Copy link
Collaborator

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editor-core Editor basic functionality feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

4 participants