ksh 自动完成和之前的命令一起
set -o vi-tabcomplete
正在打开选项卡自动完成功能
,并且
set -o emacs
正在打开历史记录(向上表示上一个命令,向下表示下一个命令)
但是,如果我设置在 ~/.kshrc 中,它仅打开 emacs(history) 之一,并且我无法打开选项卡自动完成。我错过了什么吗?
set -o vi-tabcomplete
set -o emacs
以下操作
set -o emacs
Esc, Ctrl V -- This gave me
$ Version AJM 93t+ 2010-02-02
是否执行
$ set -o emacs
$ bind "^I=complete"
ksh: bind: not found [No such file or directory]
也尝试过将这些内容放入 .kshrc
set -o emacs
bind "^I=complete"
现在,仅历史记录正在工作,而不是选项卡完整。
set -o vi-tabcomplete
is turning on tab autocomplete
and
set -o emacs
is turning on history ( up for previous command, down for next command )
But, if I set both in ~/.kshrc, it is turning on only one which is emacs(history) and I am not able to turn on tab autocomplete. Am I missing something?
set -o vi-tabcomplete
set -o emacs
Did the following
set -o emacs
Esc, Ctrl V -- This gave me
$ Version AJM 93t+ 2010-02-02
Also tried doing
$ set -o emacs
$ bind "^I=complete"
ksh: bind: not found [No such file or directory]
Also put these things in .kshrc
set -o emacs
bind "^I=complete"
Now, the history alone is working, not tab complete.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
vi 和 emacs 选项是互斥的。
检查您的 ksh 版本并更新您的问题,请:
尝试:
我不记得您是否输入插入符号-I 或控制-I 以获得正确的绑定。
The options vi and emacs are mutually exclusive.
Check your ksh version and update your question, please:
Try:
What I don't remember is whether you enter literally caret-I or control-I to get the correct bind.
在我的版本 版本 M-11/16/88f 中,使用 ksh shell 而不是 ksh93,我使用两次 ESC 键来运行它。也不是使用 Tab 键然后按两次 ESC 键的正常方式。但行为并不相同,更简单的是,在普通 shell sh 或 bash 中,当您按 TAB 键时,您会得到与已有字符串可能匹配的列表。使用此 shell 并按 ESC 键 2 次,当只有一种情况匹配时,您只会得到自动完成。如果你想看看有多少种情况可以使用“ESC+=”组合然后继续写。
恢复:
“ESC + ESC”=>当只有匹配情况时自动完成。
“ESC+=”=>显示所有匹配案例。
In my version Version M-11/16/88f using a ksh shell not the ksh93 i get it running using two times the ESC key. Also instead of a normal way of using tab then two times the ESC key. But the behaviour is not the same is more simple that in a normal shell sh or bash when you presh TAB key you get a list of possible matches with the string you already have. Using this shell and pressing the ESC key 2 times you will get only an autocomplete when there is only one case that match. If you want to see how many cases you can use "ESC + =" combination and then continue writing.
Resume:
"ESC + ESC" => autocomplete when there is only a match case.
"ESC + =" => show all the match cases.
这对我有用
输入 ~/.environ.ksh 以下内容
This worked for me
Type in ~/.environ.ksh the following
使用 echo $0 检查你的 shell -->如果这是 ksh 那么。
在 .profile 中输入以下内容: set -o vi
check your shell using echo $0 --> if this is ksh then.
make an entry in .profile as : set -o vi
只需在
.profile
文件末尾添加以下两行即可解决此问题:Just add these 2 lines in your
.profile
file at the end to fix this issue: