From c5b9f39b92ad3f38cb1c2425e82aa30e51641dac Mon Sep 17 00:00:00 2001 From: Matan Kushner Date: Wed, 17 Apr 2019 08:38:36 -0700 Subject: [PATCH] Create and document ZSH adapter (#9) ### Added - A `.zsh-theme` file as an adapter for zsh - Documentation for zsh installation ### Changed - Created an `adapter/` directory for future adapters --- README.md | 34 ++++++++++++++++--- fish_prompt.fish => adapters/fish_prompt.fish | 0 adapters/starship.zsh-theme | 1 + 3 files changed, 30 insertions(+), 5 deletions(-) rename fish_prompt.fish => adapters/fish_prompt.fish (100%) create mode 100644 adapters/starship.zsh-theme diff --git a/README.md b/README.md index 44afcfb2..f643fc82 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,9 @@ Starship is a Rust port of the minimalistic, powerful, and extremely customizabl ## Development plans The project is beginning as a port of Spaceship ZSH, but will be improved in areas where Spaceship ZSH was previously limited: -- Speed - - Concurrency of segment logic execution + +- Speed +- Concurrency of segment logic execution - Memoization of expensive operations - Safety and error handling - Testability of code @@ -38,6 +39,7 @@ I'm very new to Rust, so any help is appreciated when it comes to improving deve - [ ] Execution time of the last command if it exceeds the set threshold. ### Other features + - [ ] `.starshiprc` configuration (JSON or TOML) - [ ] Custom sections given commands or binaries - [ ] Self-updating @@ -49,8 +51,9 @@ I'm very new to Rust, so any help is appreciated when it comes to improving deve - [ ] Bash ### Test strategy -- [ ] Per-segment benchmarking -- [ ] Per-segment unit + integration tests + +- [x] Per-segment benchmarking +- [x] Per-segment unit + integration tests - [ ] Shell + OS matrix acceptance tests ## Setup @@ -58,7 +61,6 @@ I'm very new to Rust, so any help is appreciated when it comes to improving deve ### Prerequisites - Rust v1.33 or higher -- Fisher v3 ### Getting Started @@ -69,8 +71,30 @@ I'm very new to Rust, so any help is appreciated when it comes to improving deve cargo install --path . ``` +1. Navigate to the adapters directory + + ```bash + cd adapters + ``` + +#### Fish + 1. Install the fish shell prompt with fisher: ```bash fisher $PWD ``` + +#### oh-my-zsh + +1. Install the zsh theme: + + ```bash + cp starship.zsh-theme ~/.oh-my-zsh/themes + ``` + +1. In `~/.zshrc`, find the line with `ZSH_THEME=` and set it to + + ```bash + ZSH_THEME="starship" + ``` diff --git a/fish_prompt.fish b/adapters/fish_prompt.fish similarity index 100% rename from fish_prompt.fish rename to adapters/fish_prompt.fish diff --git a/adapters/starship.zsh-theme b/adapters/starship.zsh-theme new file mode 100644 index 00000000..ded50982 --- /dev/null +++ b/adapters/starship.zsh-theme @@ -0,0 +1 @@ +PROMPT='$(starship $?)'