From 07454029bd67239ce42aaa68b427fbbe8e428e7d Mon Sep 17 00:00:00 2001 From: Andrew Xie <62098008+axieax@users.noreply.github.com> Date: Fri, 21 Apr 2023 16:59:58 +1000 Subject: [PATCH] feat(starship): create plugin (#10947) Co-authored-by: Carlo Sala --- .github/CODEOWNERS | 1 + plugins/starship/README.md | 21 +++++++++++++++++++++ plugins/starship/starship.plugin.zsh | 8 ++++++++ 3 files changed, 30 insertions(+) create mode 100644 plugins/starship/README.md create mode 100644 plugins/starship/starship.plugin.zsh diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 6668cd7ce..599b765ca 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -9,3 +9,4 @@ plugins/shell-proxy/ @septs plugins/universalarchive/ @Konfekt plugins/wp-cli/ @joshmedeski plugins/zoxide/ @ajeetdsouza +plugins/starship/ @axieax diff --git a/plugins/starship/README.md b/plugins/starship/README.md new file mode 100644 index 000000000..0e66c5294 --- /dev/null +++ b/plugins/starship/README.md @@ -0,0 +1,21 @@ +# starship plugin + +Initializes [starship prompt](https://starship.rs) - a minimal, blazing-fast and infinitely customizable cross-shell prompt. + +[Demo](https://user-images.githubusercontent.com/62098008/169764279-50b48262-9506-4651-ba89-f6611a88ebf0.mp4) + +[External repository](https://github.com/axieax/zsh-starship) for this zsh plugin. + +# Installation + +**Note:** you have to [install starship](https://starship.rs/guide/#%F0%9F%9A%80-installation) first. + +## [oh-my-zsh](https://github.com/ohmyzsh/ohmyzsh) + +Add `starship` to the plugins array in your `.zshrc` file: + +```zsh +plugins=(... starship) +``` + +## ⚠️ ENABLING THIS PLUGIN WILL UNSET YOUR ZSH_THEME VARIABLE diff --git a/plugins/starship/starship.plugin.zsh b/plugins/starship/starship.plugin.zsh new file mode 100644 index 000000000..8c5d9135e --- /dev/null +++ b/plugins/starship/starship.plugin.zsh @@ -0,0 +1,8 @@ +# ignore oh-my-zsh theme +unset ZSH_THEME + +if (( $+commands[starship] )); then + eval "$(starship init zsh)" +else + echo '[oh-my-zsh] starship not found, please install it from https://starship.rs' +fi