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 a snippet for EditorConfig file content #50

Closed
wants to merge 9 commits into from

Conversation

kipit
Copy link
Contributor

@kipit kipit commented Dec 18, 2015

Event if the scope of EditorConfig files is very limited, this snippet ease the creation of EditorConfig files. All parameters except tab_size are used, as this one has a default based on indent_size.

indent_size = ${4:4}
indent_style = ${5:space}
insert_final_newline = ${6:true}
trim_trailing_whitespace = ${7:true}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can get all your default recommend settings. Can I add the indent_size as a comment?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@sindresorhus
Copy link
Owner

Good idea :) Can you add something to the readme that it's included and how to use it?

@kipit
Copy link
Contributor Author

kipit commented Dec 21, 2015

No sure the tips section is the suitable place for the snippet how-to, I've oriented the text in a tips way.

@kipit
Copy link
Contributor Author

kipit commented Dec 21, 2015

I've added a small precision for user with conflicting snippet.

@@ -0,0 +1,18 @@
<snippet>
<content><![CDATA[
# EditorConfig is awesome: http://EditorConfig.org
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drop this line

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@kipit
Copy link
Contributor Author

kipit commented Jan 13, 2016

Any advice on this ?

@kevva
Copy link

kevva commented Jan 13, 2016

👍 lgtm

Another option would be to use a default value with all the possible values, something like tab|space but this would make an invalid EditorConfig by default.

I'm not against keeping it as is.

[*.md]
trim_trailing_whitespace = false
]]></content>
<tabTrigger>editorconfig</tabTrigger>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably set scope to source.ini.editorconfig.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, in fact I dropped the scope to ease fast creation of editorconfig. The scenario I was thinking was :

  1. "Hey! I should add the EditorConfig file"
  2. Create a new file (here, ST open a Plain Text file)
  3. Call the snippet
  4. Adjust rules
  5. Save

I don't know if the initial scope of ST can parameterized by user, that's why I didn't specified the scope.
Maybe we can use source.ini.editorconfig,text.plain. No?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can use source.ini.editorconfig,text.plain. No?

👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@sindresorhus
Copy link
Owner

Sorry about the delay @kipit. I got too busy in real life. I added some inline comments, but generally looks really good :)

@kipit
Copy link
Contributor Author

kipit commented Jan 16, 2016

No problem for the delay. Your comments have been integrated, except the scope one where I need feedbacks.

@sindresorhus
Copy link
Owner

Awesome! Landed at last. Thanks for persevering through this :)

@kipit kipit deleted the add_editorconfig_snippet branch January 18, 2016 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants