Skip to content
Vladyslav Pekker edited this page Feb 3, 2016 · 6 revisions

Spells uses typesafe's config library. It looks for the default configuration files like reference.conf or application.conf etc. However, these only allow a "per application" level of configuration. Spells goes a step further and allows a "per user" configuration. Simply copy the reference.conf file into your home folder and rename it to .spells.conf.

The fallback chain is thus as follows: .spells.conf ➡️ application.conf ➡️ reference.conf.

It is possible to access the configuration values programmatically, by replacing spells with SpellsConfig and calling def value:

spells {
  terminal {
    WidthInCharacters = 160
  }
}
val width: Int = SpellsConfig.terminal.WidthInCharacters.value

Note: the type can be inferred, but is left for demonstration purposes.

Clone this wiki locally