From 7a46fd5edea3e5fc98fc0015c3136001e6086fde Mon Sep 17 00:00:00 2001 From: william wu Date: Mon, 14 Nov 2022 21:42:35 +0100 Subject: [PATCH 1/2] added oh-my-zsh like git status (with count of the file changed) --- .config/starship.toml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.config/starship.toml b/.config/starship.toml index 90b2553..1d6d72d 100644 --- a/.config/starship.toml +++ b/.config/starship.toml @@ -21,6 +21,7 @@ disabled = false [character] # The name of the module we are configuring is "character" success_symbol = "[➜](bold green)" # The "success_symbol" segment is being set to "➜" with the color "bold green" error_symbol = "[✗](bold red)" + #   # configure directory [directory] @@ -65,6 +66,17 @@ symbol = " " [git_branch] symbol = " " +[git_status] +format = '([\[$all_status$ahead_behind\]]($style) )' +stashed = "[${count}*](green)" +modified = "[${count}+](yellow)" +deleted = "[${count}-](red)" +conflicted = "[${count}~](red)" +ahead = "⇡${count}" +behind = "⇣${count}" +untracked = "[${count}?](blue)" +staged = "[${count}+](green)" + [golang] symbol = " " From bd6ccfaa14e6e6511cf93d0cba6dbee1fdc8c291 Mon Sep 17 00:00:00 2001 From: william wu Date: Mon, 14 Nov 2022 21:48:16 +0100 Subject: [PATCH 2/2] added git state information --- .config/starship.toml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.config/starship.toml b/.config/starship.toml index 1d6d72d..453ea6a 100644 --- a/.config/starship.toml +++ b/.config/starship.toml @@ -1,7 +1,7 @@ #format = """ #[╭─user───❯](bold blue) $username #[┣─system─❯](bold yellow) $hostname -#[┣─project❯](bold red) $directory$rust$git_branch$git_status$package$golang$terraform$docker_context$python$docker_context$nodejs +#[┣─project❯](bold red) $directory$rust$git_branch$git_state$git_status$package$golang$terraform$docker_context$python$docker_context$nodejs #[╰─cmd────❯](bold green) #""" [username] @@ -77,6 +77,17 @@ behind = "⇣${count}" untracked = "[${count}?](blue)" staged = "[${count}+](green)" +[git_state] +style = "bold red" +format = "[$state( $progress_current/$progress_total) ]($style)" +rebase = "rebase" +merge = "merge" +revert = "revert" +cherry_pick = "cherry" +bisect = "bisect" +am = "am" +am_or_rebase = "am/rebase" + [golang] symbol = " "