mirror of
https://github.com/ahmetb/kubectx.git
synced 2025-07-19 17:49:18 +00:00
README: Install completion for zsh & Linux (#80)
This commit is contained in:
parent
365fa23d87
commit
34a9e100c8
15
README.md
15
README.md
@ -101,7 +101,20 @@ them to any POSIX environment that has Bash installed.
|
|||||||
- or save them to a directory, then create symlinks to `kubectx`/`kubens` from
|
- or save them to a directory, then create symlinks to `kubectx`/`kubens` from
|
||||||
somewhere in your `PATH`, like `/usr/local/bin`
|
somewhere in your `PATH`, like `/usr/local/bin`
|
||||||
- Make `kubectx` and `kubens` executable (`chmod +x ...`)
|
- Make `kubectx` and `kubens` executable (`chmod +x ...`)
|
||||||
- Figure out how to install bash/zsh/fish [completion scripts](completion/).
|
- Install bash/zsh/fish [completion scripts](completion/).
|
||||||
|
- For zsh:
|
||||||
|
The completion scripts have to be in a path that belongs to `$fpath`. Either link or copy them to an existing folder.
|
||||||
|
If using oh-my-zsh you can do as follows:
|
||||||
|
```bash
|
||||||
|
mkdir -p ~/.oh-my-zsh/completions
|
||||||
|
chmod -R 755 ~/.oh-my-zsh/completions
|
||||||
|
ln -s /opt/kubectx/completion/kubens.zsh ~/.oh-my-zsh/completions/_kubens.zsh
|
||||||
|
ln -s /opt/kubectx/completion/kubens.zsh ~/.oh-my-zsh/completions/_kubectx.zsh
|
||||||
|
```
|
||||||
|
Note that the leading underscore seems to be a convention.
|
||||||
|
If not using oh-my-zsh, you could link to `/usr/share/zsh/functions/Completion` (might require sudo), depending on the `$fpath` of your zsh installation.
|
||||||
|
In case of error, calling `compaudit` might help.
|
||||||
|
- For bash/fish: Figure out how to install completion scripts and please document here
|
||||||
|
|
||||||
Example installation steps:
|
Example installation steps:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user