gpt4 book ai didi

alias - 在 tcsh 中扩展别名

转载 作者:行者123 更新时间:2023-12-02 15:34:46 32 4
gpt4 key购买 nike

在 bash 中它看起来像是 alias-expand-line

我可以添加到 .cshrc_custom 文件的 bindkey 命令是什么?

有点相关:"^[y" 指的是什么键绑定(bind)?我知道 ^ctrl,但是 [ 是什么?

最佳答案

运行 man tcsh 并搜索“别名”产生:

normalize-command (^X-?)
Searches for the current word in PATH and, if it is found, replaces it with the full path to the executable. Special characters are quoted. Aliases are expanded and quoted but commands within aliases are not. This command is useful with commands that take commands as arguments, e.g., ‘dbx’ and ‘sh -x’.

例如:

% alias hi echo hello
% hi

当光标紧跟在 hi 之后时键入 Ctrl-X ? 将其扩展为 echo hello。并且由于它已经绑定(bind),您不一定需要触摸您的启动文件(除非您想更改绑定(bind))。

一个问题:它扩展到别名的定义,不一定扩展到别名会扩展到的内容。例如,给定:

% alias echo2 'echo \!:2'

(仅回显其第二个参数),键入 echo2 后跟 Ctrl-X ? 将其逐字扩展为 echo ! :2

关于alias - 在 tcsh 中扩展别名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19799437/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com