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

[Plugin Request] .editorconfig support #54

Open
Tmpod opened this issue Jun 9, 2020 · 6 comments
Open

[Plugin Request] .editorconfig support #54

Tmpod opened this issue Jun 9, 2020 · 6 comments
Labels
plugin suggestion Suggestion for a plugin

Comments

@Tmpod
Copy link
Contributor

Tmpod commented Jun 9, 2020

Porting the issue from rxi/lite#142

.editorconfig is a nice "standardised" way of specifying some configurations across all editors that support it. This is a neat tool to use in big projects with lots of contributorsa and it would be cool to have in lite too, if not on the core, at least as a plugin.

You can read more about .editorconfig at https://editorconfig.org

I do not know Lua nor this project so at the moment I'm not able to write such plugin. I'd be really thankful if someone with more experience would do it, but if that doens't happen I'll eventually write it :)

@rxi rxi added the plugin suggestion Suggestion for a plugin label Jun 9, 2020
@MarcusE1W
Copy link

Maybe the editorconfig plugin for Micro could be of help ?
Micro also uses Lua for the plugin system. (The editor itself is written in Go)

https://github.com/10sr/editorconfig-micro

@liquidev
Copy link
Contributor

I'm currently working on an editorconfig support plugin for lite. There is a bit of hackery involved with supporting config options like indent_size, tab_type, etc. per document, and I thought about splitting that into a plugin of its own, but I'm not sure what the guidelines on "library plugins" are (whether they should exist, or should each plugin include all of its functionality in a single file).

Since editorconfig doesn't support adding vertical rulers/setting maximum column numbers yet, I wanted to add an extra non-standard setting to support that:

[*.rs]
lite_line_limit = 120

As far as I gathered from reading editorconfig#89, one commenter pointed out that the Atom plugin uses a more generic name max_line_length, so I'm not sure what to pick yet.

@benstigsen
Copy link
Contributor

Well since this plugin will be made for lite itself, I do not think it is necessary to use in the variable names.

@Tmpod
Copy link
Contributor Author

Tmpod commented Feb 14, 2021

I totally forgot about this... I could try to write this now, or contribute to someone else's work.

It does indeed seem to require some work for per-file configs, but it shouldn't be too hard. Any repository I can contribute to?

@liquidev
Copy link
Contributor

@Tmpod not yet, I want to get the plugin working first and then I'll send a PR to this repo.

@liquidev
Copy link
Contributor

You can find a preview version of the plugin in this gist. Let me know if you run into any crashes, and what things I could improve. One notable thing is that right now .editorconfig is not hot-reloaded once you modify it, so you'll have to close and reopen the document (or just restart the editor) for any changes to be applied.

Jipok pushed a commit to Jipok/lite-plugins that referenced this issue Dec 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin suggestion Suggestion for a plugin
Projects
None yet
Development

No branches or pull requests

5 participants