1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-06-17 15:52:47 +00:00
starship/src/configs/character.rs
Thomas O'Donnell 67619386cd
fix(character): Standadise Vim config names (#4081)
Have switched all vi/vim symbols to have the same prefix 'vim'. To
preserve backwards compatibility with existing configs I have added an
alias for the previous config name.
2022-06-18 23:23:59 +02:00

32 lines
998 B
Rust
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

use serde::{Deserialize, Serialize};
#[derive(Clone, Deserialize, Serialize)]
#[cfg_attr(feature = "config-schema", derive(schemars::JsonSchema))]
#[serde(default)]
pub struct CharacterConfig<'a> {
pub format: &'a str,
pub success_symbol: &'a str,
pub error_symbol: &'a str,
#[serde(alias = "vicmd_symbol")]
pub vimcmd_symbol: &'a str,
pub vimcmd_visual_symbol: &'a str,
pub vimcmd_replace_symbol: &'a str,
pub vimcmd_replace_one_symbol: &'a str,
pub disabled: bool,
}
impl<'a> Default for CharacterConfig<'a> {
fn default() -> Self {
CharacterConfig {
format: "$symbol ",
success_symbol: "[](bold green)",
error_symbol: "[](bold red)",
vimcmd_symbol: "[](bold green)",
vimcmd_visual_symbol: "[](bold yellow)",
vimcmd_replace_symbol: "[](bold purple)",
vimcmd_replace_one_symbol: "[](bold purple)",
disabled: false,
}
}
}