-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2345ac1
commit a039596
Showing
2 changed files
with
23 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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" | ||
|
||
|
@@ -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 | ||
|
||
|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
source ${0:A:h}/kubectl.zsh |