Configuration
noughtmare opened this issue · 1 comments
First of all I want to make clear that by configuration I mean simple configuration like font size or enabling line numbers.
I've done some thinking and I came to the conclusion that there are multiple places where things can be configured:
- Global editor configuration
(http://hackage.haskell.org/package/yi-core-0.17.1/docs/Yi-Types.html#t:Config) - Buffer configuration
(http://hackage.haskell.org/package/yi-core-0.17.1/docs/Yi-Types.html#t:Attributes) - Mode configuration
(http://hackage.haskell.org/package/yi-core-0.17.1/docs/Yi-Types.html#t:Mode) - Frontend configuration (This is actually a subfield of the global editor configuration)
(http://hackage.haskell.org/package/yi-core-0.17.1/docs/Yi-Types.html#t:UIConfig)
This list might not even be complete. I think we can do better! I suspect there is a more uniform way to handle configuration.
There are some points where I think we can improve the current situation:
- Make a uniform configuration data type that can be used instead of the ad-hoc configurations listed above.
- Think of a mechanism for handling and configuring the precedence of these configurations.
- Use extensible records for configuration instead of the
DynamicState
type (for example using Data types à la carte). - Read configurations from a file so that users no longer have to restart their editor to change a minor setting.
I do not care about multi-configurations and extensible records, if we can validate the configurations.
But I hope serializable and not serializable data are separated. Not serializable data is like IO-actions.
I am trying last one(configuration-file) like this.
The configuration file can not include keymap, as the map is not serializable data.