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
14 changes: 14 additions & 0 deletions editorconfig.sublime-snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<snippet>
<content><![CDATA[
root = ${1:true}
Copy link
Owner

Choose a reason for hiding this comment

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

Remove the configurability here. 99% of people would set it to true.

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


[*]
charset = ${2:utf-8}
end_of_line = ${3:lf}
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.

👍

]]></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!

</snippet>