Skip to content

Commit 849eed7

Browse files
committed
[zh] Update optional-kubectl-configs-zsh.md
Signed-off-by: xin.li <[email protected]>
1 parent 8b78312 commit 849eed7

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

content/zh/docs/tasks/tools/included/optional-kubectl-configs-zsh.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,19 @@ source <(kubectl completion zsh)
2626
```
2727

2828
<!--
29-
If you have an alias for kubectl, you can extend shell completion to work with that alias:
29+
If you have an alias for kubectl, kubectl autocompletion will automatically work with it.
3030
-->
31-
如果你为 kubectl 定义了别名,可以扩展脚本补全,以兼容该别名。
32-
33-
```zsh
34-
echo 'alias k=kubectl' >>~/.zshrc
35-
echo 'compdef __start_kubectl k' >>~/.zshrc
36-
```
31+
如果你为 kubectl 定义了别名,kubectl 自动补全将自动使用它。
3732

3833
<!--
3934
After reloading your shell, kubectl autocompletion should be working.
4035
4136
If you get an error like `complete:13: command not found: compdef`, then add the following to the beginning of your `~/.zshrc` file:
37+
If you get an error like `2: command not found: compdef`, then add the following to the beginning of your `~/.zshrc` file:
4238
-->
4339
重新加载 shell 后,kubectl 自动补全功能将立即生效。
4440

45-
如果你收到 `complete:13: command not found: compdef` 这样的错误提示,那请将下面内容添加到 `~/.zshrc` 文件的开头:
46-
41+
如果你收到 `2: command not found: compdef` 这样的错误提示,那请将下面内容添加到 `~/.zshrc` 文件的开头:
4742
```zsh
4843
autoload -Uz compinit
4944
compinit

0 commit comments

Comments
 (0)