小编mik*_*ike的帖子

在vi模式下在bash中插入最后一个参数而不插入前导空格

在默认 (emacs) 模式下使用 bash 当我点击Esc,? ..

$ echo hello
hello
$ hello  # I hit `<ESC>.` to insert this
Run Code Online (Sandbox Code Playgroud)

请注意hello,当我点击时插入的单词前没有空格Esc,?..

如果我切换到 vi 模式并进行配置,.我会得到一个前导空格:

$ set -o vi
$ bind -m vi-command ".":yank-last-arg
$ echo hello
hello
$  hello  # I hit `<ESC>.` to insert this. Note the leading space.
Run Code Online (Sandbox Code Playgroud)

有没有办法配置 bash/readline 来避免这个前导空间?

bash readline vi-mode

7
推荐指数
1
解决办法
120
查看次数

标签 统计

bash ×1

readline ×1

vi-mode ×1