[Plugin Request] .editorconfig support
Tmpod opened this issue · 6 comments
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 :)
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)
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.
Well since this plugin will be made for lite itself, I do not think it is necessary to use in the variable names.
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?
@Tmpod not yet, I want to get the plugin working first and then I'll send a PR to this repo.
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.