Skip to content

Commit

Permalink
Enable the use of oh-my-zsh (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
SmithPeder authored and superbrothers committed Apr 21, 2019
1 parent 2345ac1 commit 414acd6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ This script displays information about the kubectl current context and namespace

## Usage


Clone this repository and source the `kubectl.zsh` from your `~/.zshrc` config file, and configure your prompt.

```sh
autoload -U colors; colors
source /path/to/zsh-kubectl-prompt/kubectl.zsh
RPROMPT='%{$fg[blue]%}($ZSH_KUBECTL_PROMPT)%{$reset_color%}'
```

Also you can install with homebrew.

```console
$ brew tap superbrothers/zsh-kubectl-prompt
$ brew install zsh-kubectl-prompt
Expand All @@ -23,18 +24,21 @@ $ brew install zsh-kubectl-prompt
## Customization

Change the separator between context and namespace:

```sh
zstyle ':zsh-kubectl-prompt:' separator '|'
```

Does not display the current namespace:

```sh
zstyle ':zsh-kubectl-prompt:' namespace false
```

## With a plugin manager

If you use [zgen](https://github.com/tarjoilija/zgen), load this repository as follows:

```sh
source "${HOME}/.zgen/zgen.zsh"

Expand All @@ -52,6 +56,7 @@ RPROMPT='%{$fg[blue]%}($ZSH_KUBECTL_PROMPT)%{$reset_color%}'
```

If you use [antigen](https://github.com/zsh-users/antigen), load this repository as follows:

```sh
source /path-to-antigen/antigen.zsh

Expand All @@ -65,6 +70,22 @@ autoload -U colors; colors
RPROMPT='%{$fg[blue]%}($ZSH_KUBECTL_PROMPT)%{$reset_color%}'
```

If you use [oh-my-zsh](https://ohmyz.sh/), load this repository as follows:

1. Clone the repo into oh-my-zsh custom plugins folder

```sh
git clone [email protected]:superbrothers/zsh-kubectl-prompt.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-kubectl-prompt
```

2. Activate the plugin your `.zshrc` by appending it to the plugin section

```sh
plugins=( [plugins...] zsh-kubectl-prompt)
```

> **Note:** Remember to source the `.zshrc` or restart your shell after step 2
## License

This script is released under the MIT License.
1 change: 1 addition & 0 deletions zsh-kubectl-prompt.plugin.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
source ${0:A:h}/kubectl.zsh

0 comments on commit 414acd6

Please sign in to comment.