我有一个庆典 - 制表完成脚本。有没有从zsh中使用一个简单的方法? [英] I have a bash-tab-completion script. Is there a simple way to use it from zsh?

查看:103
本文介绍了我有一个庆典 - 制表完成脚本。有没有从zsh中使用一个简单的方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Apache的Hadoop的一个bash-tab补脚本。通常情况下,我使用的zsh作为我一天到一天的外壳。它往往是pretty bash类似的,当我需要它,但它看起来像制表完成系统是它们之间的根本不同。有没有一种简单的方法来转换现有的bash-tab补定义在zsh来工作?我不希望投资一吨就在这个时候,但如果它很容易我会节省精力适量。

I have a bash-tab-completion script for Apache's Hadoop. Normally, I use zsh as my day-to-day shell. It tends to be pretty bash-like when I need it to be, but it looks like the tab-completion systems are radically different between them. Is there a simple way to "convert" the existing bash-tab-completion definitions to work in zsh? I don't want to invest a ton of time in this, but if it's easy I'd save a moderate amount of effort.

推荐答案

页面(二零一零年/ 01 / 05):

From this page (dated 2010/01/05):

岩组能够处理的bash补全功能。 zsh的最新开发版本有一个功能bashcompinit,当运行将使zsh来阅读bash补全规格和功能。这是在zshcompsys手册页中。要使用它,你需要做的是在compinit后的任何时间运行bashcompinit。这将确定对应的bash内建完整,compgen功能。

Zsh can handle bash completions functions. The latest development version of zsh has a function bashcompinit, that when run will allow zsh to read bash completion specifications and functions. This is documented in the zshcompsys man page. To use it all you need to do is run bashcompinit at any time after compinit. It will define complete and compgen functions corresponding to the bash builtins.

这篇关于我有一个庆典 - 制表完成脚本。有没有从zsh中使用一个简单的方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆