请问各位linux高手,set -o vi作用是什么?

请问各位linux高手,set -o vi作用是什么? 请问各位linux高手,set -o vi作用是什么?

先说答案,打开vi的debug模式。
[bigdata@master bin]$ set -o #查看当前设置情况
allexport off
braceexpand on
emacs off
errexit off
errtrace off
functrace off
hashall on
histexpand on
history on
ignoreeof off
interactive-comments on
keyword off
monitor on
noclobber off
noexec off
noglob off
nolog off
notify off
nounset off
onecmd off
physical off
pipefail off
posix off
privileged off
verbose off
vi off #关闭中
xtrace off

PS3:
[bigdata@master bin]$ set -o vi #把vi选项打开
[bigdata@master bin]$ set -o #查看当前设置情况
allexport off
braceexpand on
emacs off
errexit off
errtrace off
functrace off
hashall on
histexpand on
history on
ignoreeof off
interactive-comments on
keyword off
monitor on
noclobber off
noexec off
noglob off
nolog off
notify off
nounset off
onecmd off
physical off
pipefail off
posix off
privileged off
verbose off
vi on #已经打开
xtrace off
温馨提示:答案为网友推荐,仅供参考
第1个回答  推荐于2017-09-27
让bash 模拟 vi 的操作。默认的是模拟 emacs。vi 你会用吗?如果不会可能不知道是什么意思。vi 和 emacs 是 UNIX/Linux 下最广泛使用的两个编辑器。除了能打打字以外,还能做很多工作。比如你 set 好了之后,按几下 esc 键。就可以用 j 或者 k 就可以上下翻阅命令历史,而不必用上下键。按 i 键进入 插入模式(insert mode) 之后,才可以继续打字之类的。这个应该是为了迎合 vi 向的程序员,不过我想即使是 vier 也应该觉得在命令行上用 emacs 的快捷键方便点。毕竟在命令行上最常做的工作就是简单的打字,而不是移动或编辑。vi 发挥不了太大的优势。 查看原帖>>

希望采纳本回答被提问者采纳