Coder Social home page Coder Social logo

ashmckenzie / atom-editorconfig Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sindresorhus/atom-editorconfig

0.0 2.0 0.0 1.74 MB

Helps developers maintain consistent coding styles between different editors

Home Page: https://atom.io/packages/editorconfig

License: MIT License

JavaScript 99.03% CSS 0.97%

atom-editorconfig's Introduction

EditorConfig Build Status

EditorConfig helps developers maintain consistent coding styles between different editors.

"I will take a peanut butter sandwich on white bread" -- Ralph S. Mouse

Install

$ apm install editorconfig

Or, Settings โ†’ Install โ†’ Search for editorconfig

Getting started

See the EditorConfig documentation for a detailed description of the .editorconfig file format.

  1. Open a project containing an .editorconfig file.
  2. Whenever you open a file in the project (or change any .editorconfig file from within Atom), EditorConfig evaluates the EditorConfig settings for the current file.
  3. EditorConfig then applies these settings to your current editor pane. Any change you make from now on will follow the EditorConfig settings. EditorConfig does not automatically fix older files it considers as malformed.
  4. You can always check your EditorConfig settings against the current file using the EditorConfig: Show State command. You can try to fix malformed files using the command EditorConfig: Fix File.

๐Ÿ’ก If EditorConfig detects any issues which may prevent it from working properly a ๐Ÿญ will appear in the status bar; click on it to open the state notification.

โš ๏ธ EditorConfig will not automatically fix malformed files (e.g. change all soft tabs to hard tabs) -- you need to use the EditorConfig: Fix File command on each malformed file. Keep in mind that malformed files (especially mixed tab characters) may lead to unexpected behaviour.

Supported properties

  • root
  • indent_style
  • indent_size / tab_width (indent_size takes precedence over tab_width)
  • charset (supported values: latin1, utf-8, utf-16be, utf-16le)
  • end_of_line (supported values: lf, crlf)
  • trim_trailing_whitespace (supported values: true, false)
  • insert_final_newline (supported values: true, false; Setting this to false strips final newlines)
  • max_line_length

๐Ÿ’ก Any malformed or missing property falls back to unset which leaves the control to Atom.

EditorConfig commands

  • EditorConfig: Fix File: Fixes indent_style and end_of_line issues for the current editor.
  • EditorConfig: Show State: Shows the current state of EditorConfig for your current editor.
  • EditorConfig: Generate Config: Generates an initial .editorconfig for your project.

Features

  • Applies the settings from your .editorconfig file
  • Ability to fix indent_style and end_of_line issues
  • Syntax highlights .editorconfig files (now with specification-like case insensitivity)
  • Ability to generate an .editorconfig file based on the current settings
  • Displays a nifty ๐Ÿญ in the statusBar whose color shows you if EditorConfig faces any problems
  • Clicking on the ๐Ÿญ invokes the Show State command for you
  • Recognizes if you save any .editorconfig file and reapplies all settings to all opened editor-panes

Example file

root = true

[*]
indent_style = tab
indent_size = 3
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.{json,yml}]
indent_size = 2

[*.md]
trim_trailing_whitespace = false

Changelog

  • 2.3: Add support for upcoming multiple Wrapguides
  • 2.2: Respecting Atom's SoftWrap && SoftWrapAtPreferredLineLength-setting; Drops custom WrapGuide-implementation and sane intercepts the core wrap-guide; Fix mouse-icon-precedence (thanks to gorriecoe); Preserves additional spaces on Fix File; Added warning for interfering 'tabs-to-spaces'-configuration
  • 2.1: Supporting Atom's upcoming Shadow-DOM transition; optimizing package size
  • 2.0: We finally support all EditorConfig properties (with the recently added max_line_length); introducing EditorConfig: Fix File; fixing EditorConfig's onSave handling
  • 1.7: Showing the StatusBar icon only on problems; introducing EditorConfig: Show State; optimizing grammar

Troubleshooting

We're sorry to hear you're having trouble using atom-editorconfig! Please bear some caveats in mind:

  • Why isn't EditorConfig applying the indentation character to my files? EditorConfig is not intended to do so; it will apply the indentation char only to new indentations. You may try to fix indentation issues with the EditorConfig: Fix File command.
  • Why is indent_style not working? You can set Atom's config setting "Tab Type" to either soft or hard, this prevents EditorConfig from influencing the indentation style. Set Atom's "Tab Type" to auto to allow EditorConfig taking control over the indentation characters.
  • Why is feature X not working? Some other packages (e.g. the "whitespace" package) override the EditorConfig settings. In these cases, we try to alert you about confirmed interferences and suggest that you try disabling the other package. If you face any unreported issues, please let us know.

๐Ÿ’ก You can check how EditorConfig affects your current file by invoking the EditorConfig: Show State command. If EditorConfig detects any issues which may prevent it from working properly it displays a ๐Ÿญ in the status bar; clicking on it opens the state notification (like the Show State command).

Help us get better

We would be happy to hear from you -- please report any feedback, issues or ideas. Thank you! ๐Ÿ’

๐Ÿ’ We thank our contributors for their amazing work to make Atom support editorconfig!

Maintainer

License

MIT ยฉ Sindre Sorhus

atom-editorconfig's People

Contributors

alaycock avatar alhadis avatar arnaudrinquin avatar brunetton avatar caleb avatar caleb531 avatar chpio avatar dbachko avatar fleeting avatar florianb avatar gorriecoe avatar kevva avatar milan avatar sindresorhus avatar tjallen avatar ulrikstrid avatar varemenos avatar vinkla avatar yudai-nkt avatar zimme avatar

Watchers

 avatar  avatar

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.