Giter VIP home page Giter VIP logo

Comments (6)

jednano avatar jednano commented on August 20, 2024 1

@cblp, can you give me a short example of a file that would use both of these settings at the same time and why? I'm just having a hard time picturing a scenario in which this would be a good idea, but I'm all ears.

from editorconfig-vscode.

cblp avatar cblp commented on August 20, 2024 1

Here's an example of such Makefile.

build:
    find -name '*.c' \
    | xargs
        grep
          --only-matching
          pattern

Unfortunately, GIthub replaces tab character with 4 spaces, so we have to pretend there is a tab.

from editorconfig-vscode.

olzaragoza avatar olzaragoza commented on August 20, 2024 1
[*]
indent_style = tab
tab_width = 4

screen1

is this what you want?

from editorconfig-vscode.

cblp avatar cblp commented on August 20, 2024

Are you asking for a file, using both indentation and tabs? Indentation is used in almost all programming languages, and tab character may be used in almost any text file. For example, I can indent my C code by 4 spaces and use tabulation in comments to align ASCII drawings.

Moreover, one can use tab even in indentation! Just look at any Makefile. Its syntax makes you indent bodies of recipes with tabulation. But using tabs to indent code inside recipes is too wastefully. So many people (at least, as I can see), use 2-4 spaces to indent inner blocks inside recipes.

Despite of all that, do you know, why somebody on Earth may want to change the tab size?

from editorconfig-vscode.

jednano avatar jednano commented on August 20, 2024

Unfortunately, I don't know where the tab is supposed to be!

I think I get what you're saying now though... kinda. I'm personally a fan of tabs for indentation, spaces for alignment, so you would never see tabs follow indentation in one of my files. Here's why...

tabs-vs-spaces

As such, I would never actually declare the tab_width setting in an .editorconfig file, because I believe the user should be in control of what they deem an appropriate tab size. As long as the rules are followed according to my animated GIF above, people can feel free to use whatever they want.

That said, are you still convinced of a need for a file with "tabs for alignment following indentation"? I believe this is what you're trying to achieve. I've always felt that was a big NO NO, but you have me 2nd guessing myself.

from editorconfig-vscode.

jednano avatar jednano commented on August 20, 2024

Closing, as there has been no responses.

from editorconfig-vscode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.