diff options
| -rw-r--r-- | .zshrc | 43 | ||||
| -rw-r--r-- | home-manager/home.nix | 50 |
2 files changed, 50 insertions, 43 deletions
@@ -242,7 +242,6 @@ function __cd_parent_dir() { [ -e $BUFFER ] || return pushd .. > /dev/null - __update_vcs_info __change_terminal_title zle reset-prompt } @@ -254,7 +253,6 @@ function __cd_prev_dir() { [ -e $BUFFER ] || return popd > /dev/null - __update_vcs_info __change_terminal_title zle reset-prompt } @@ -277,47 +275,6 @@ bindkey "^G" __cd_project_root_dir zmodload zsh/complist - -autoload -Uz vcs_info - - -zstyle ':vcs_info:git:*' formats ' (%b)%u%m' -zstyle ':vcs_info:git:*' actionformats ' (%b %a)%u%m' -zstyle ':vcs_info:git:*' unstagedstr '+' -zstyle ':vcs_info:git:*' check-for-changes true -zstyle ':vcs_info:git+set-message:*' hooks git-stash-count - -# Add stash count to VCS info. -function +vi-git-stash-count() { - local stash="$(git stash list 2>/dev/null | wc -l | tr -d ' ')" - if [[ "${stash}" -gt 0 ]]; then - hook_com[misc]=" [${stash}]" - else - hook_com[misc]="" - fi -} - - -function __update_vcs_info() { - psvar=() - LANG=en_US.UTF-8 vcs_info - if [[ -n "$vcs_info_msg_0_" ]]; then - psvar[1]="$vcs_info_msg_0_" - fi -} - -function precmd() { - __update_vcs_info -} - - - -PROMPT=" -%75F%B%~%b%1(v,%1v,) -%150F❯%153F❯%159F❯%f " - -PROMPT2="%63F❯%62F❯%61F❯%f " - SPROMPT="%179F%BDid you mean %r? (n/y):%b%f " diff --git a/home-manager/home.nix b/home-manager/home.nix index 3b69c97..fbd38c5 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -107,4 +107,54 @@ in initExtra = builtins.readFile ../.zshrc; }; + + programs.starship = { + enable = true; + + settings = { + add_newline = true; + format = "[$directory$git_branch$git_commit$git_status$git_state](bold fg:75)$fill$cmd_duration$time$line_break$character"; + continuation_prompt = "[❯](fg:63)[❯](fg:62)[❯](fg:61) "; + character = { + success_symbol = "[❯](fg:150)[❯](fg:153)[❯](fg:159)"; + error_symbol = "[❯](fg:172)[❯](fg:173)[❯](fg:174)"; + }; + directory = { + format = "$path "; + use_os_path_sep = false; + truncate_to_repo = false; + truncation_length = 99; + }; + git_branch = { + format = "\\($branch\\)"; + }; + git_commit = { + format = "($hash$tag)"; + tag_disabled = false; + tag_symbol = " @"; + }; + git_status = { + format = "$conflicted$modified$untracked$staged$stashed"; + conflicted = "!"; + modified = "~"; + untracked = "?"; + staged = "*"; + stashed = " \\[$count\\]"; + }; + git_state = { + format = " - $state ($progress_current/$progress_total) "; + }; + cmd_duration = { + format = "~$duration "; + }; + time = { + disabled = false; + format = "\\[$time\\] "; + time_format = "%T"; + }; + fill = { + symbol = " "; + }; + }; + }; } |
