diff --git a/src/config.rs b/src/config.rs index 9f61385..2dad7be 100644 --- a/src/config.rs +++ b/src/config.rs @@ -7,6 +7,9 @@ use std::fs::File; use std::io::Read; use serde::{Serialize, Deserialize}; +// TODO: add documentation link +const DEFAULT_CONFIG_FILE_CONTENT : &str = include_str!("res/config.yaml"); + #[derive(Debug, Serialize, Deserialize)] pub struct Configs { pub matches: Vec @@ -44,55 +47,4 @@ impl Configs { panic!("Could not generate default position for config file"); } } -} - -// TODO: add documentation link -const DEFAULT_CONFIG_FILE_CONTENT : &str = r###"# espanso configuration file -# This is the default configuration file, change it as you like it -# You can refer to the official documentation: - -# Matches are the substitution rules, when you type the "trigger" string -# it gets replaced by the "replace" string. -matches: - # Default - - trigger: ":espanso" - replace: "Hi there!" - - # Emojis - - trigger: ":lol" - replace: "😂" - - trigger: ":llol" - replace: "😂😂😂😂" - - trigger: ":sad" - replace: "☹" - - trigger: ":ssad" - replace: "☹☹☹☹" - - # Accented letters - - trigger: "e'" - replace: "è" - - trigger: "e/" - replace: "é" - - trigger: "a'" - replace: "à" - - trigger: "i'" - replace: "ì" - - trigger: "o'" - replace: "ò" - - trigger: "u'" - replace: "ù" - - # Capital accented letters - - trigger: "E'" - replace: "È" - - trigger: "E/" - replace: "É" - - trigger: "A'" - replace: "À" - - trigger: "I'" - replace: "Ì" - - trigger: "O'" - replace: "Ò" - - trigger: "U'" - replace: "Ù" -"###; \ No newline at end of file +} \ No newline at end of file diff --git a/src/res/config.yaml b/src/res/config.yaml new file mode 100644 index 0000000..2e5676f --- /dev/null +++ b/src/res/config.yaml @@ -0,0 +1,49 @@ +# espanso configuration file + +# This is the default configuration file, change it as you like it +# You can refer to the official documentation: + +# Matches are the substitution rules, when you type the "trigger" string +# it gets replaced by the "replace" string. +matches: + # Default + - trigger: ":espanso" + replace: "Hi there!" + + # Emojis + - trigger: ":lol" + replace: "😂" + - trigger: ":llol" + replace: "😂😂😂😂" + - trigger: ":sad" + replace: "☹" + - trigger: ":ssad" + replace: "☹☹☹☹" + + # Accented letters + - trigger: "e'" + replace: "è" + - trigger: "e/" + replace: "é" + - trigger: "a'" + replace: "à" + - trigger: "i'" + replace: "ì" + - trigger: "o'" + replace: "ò" + - trigger: "u'" + replace: "ù" + + # Capital accented letters + - trigger: "E'" + replace: "È" + - trigger: "E/" + replace: "É" + - trigger: "A'" + replace: "À" + - trigger: "I'" + replace: "Ì" + - trigger: "O'" + replace: "Ò" + - trigger: "U'" + replace: "Ù" \ No newline at end of file