加入收藏 | 设为首页 | 会员中心 | 我要投稿 鄂州站长网 (https://www.0711zz.com/)- 数据分析、网络、云渲染、应用安全、大数据!
当前位置: 首页 > 综合聚焦 > Linux > 正文

zsh完成差异

发布时间:2021-01-17 11:23:10 所属栏目:Linux 来源:互联网
导读:我看到很多人这样做 autoload -Uz compinit compinit 和其他人这样做 autoload -U compinit compinit -i 我想知道这个区别.我应该使用哪一个? 自动加载,从 man zshbuiltins: The flags -z and -k mark the function to be autoloaded in native or ksh emu

我看到很多人这样做
autoload -Uz compinit
compinit
和其他人这样做
autoload -U compinit
compinit -i
我想知道这个区别.我应该使用哪一个?

解决方法

自动加载,从 man zshbuiltins

The flags -z and -k mark the function to be autoloaded in native or ksh emulation,as if the option KSH_AUTOLOAD were unset or were set,respectively.

-U标志可以追溯到:autoload等效于功能-u,这相当于排版-f.简而言之,排版用于:

Set or display attributes and values for shell parameters.

当-f与-U组合使用时:

[The -f flag causes] The names refer to functions rather than parameters. … The -u and -U flags cause the function to be marked for autoloading; -U also causes alias expansion to be suppressed when the function is loaded.

compinit是compsys使用的完成初始化函数,“较新的”Z-Shell完成系统.详见man zshcompsys.

-i标志用于:

to make compinit silently ignore all insecure files and directories use the option -i

一般来说,您应该使用autoload -Uz,根据this interesting read.

(编辑:鄂州站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读