-
Notifications
You must be signed in to change notification settings - Fork 19
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
Config file #53
Comments
This would be a really nice enhancement. We could do something like a struct Config {
red: Color,
blue: Color,
// ...
prelude_path: PathBuf,
}
lazy_static! {
static ref CONFIG: Config = Config::read();
}
fn main() {
parse(read(&CONFIG.prelude_path));
} Normally, I would want to keep something like this encapsulated within the Dune interpreter itself, but that's impossible to do if we don't know the custom prelude path. |
I'd like to implement this. Here's my idea how it should work:
In the default configuration, Here's an example configuration file: # Configuration file for dune shell
version = "0.1.7" # dunesh version for which this config file was created
extends = "default" # a path to another config file can be specified here
preludes = [
# the `~` is expanded to the home directory
# relative paths are resolved relative to this file
"~/dunesh/completions.dune",
"~/dunesh/abbreviations.dune",
"~/dunesh/util.dune",
"./docker_util.dune",
"/etc/**/prelude.dune"
]
history = "~/.dunesh_history"
use_shortcuts = "custom"
use_theme = "dark"
[shortcuts.custom]
extends = "default"
"ctrl+leftarrow" = "move_wb_left"
"ctrl+rightarrow" = "move_wb_right"
"page_up" = "move_start"
"escape" = "clear_input"
[shortcuts.vi.insert]
# configuration for vi shortcuts in "insert" mode
"ctrl+leftarrow" = "move_wb_left"
"ctrl+rightarrow" = "move_wb_right"
[themes.dark]
extends = "default_dark"
strings = "#ffcc77"
numbers = "#44aaff"
errors = { color = "#f55", bold = true }
operators = {} # don't use any color or style I'll start implementing the things that already exist: Prelude(s) and history. |
What a config file could contain:
The config file should be read from
~/.config/dune/
orXDG_CONFIG_DIR
or whatever the platform default is. This can be done with thedirs-next
crate.The text was updated successfully, but these errors were encountered: