fish shell绑定不起作用(MacOS,iterm2,fish 3.5.1)

wmtdaxz3  于 2023-01-09  发布在  Shell
关注(0)|答案(1)|浏览(140)

无法绑定^F(ctrl+F)来完成自动建议。

也想把它永久化-

# ~/.config/fish/config.fish
function fish_user_key_bindings
    bind \cr 'direnv allow'
    bind \cf accept-autosuggestion
end

if status is-interactive
    # Commands to run in interactive sessions can go here
    fish_user_key_bindings
end

系统构建和配置-我有铁锁元素和更好的触摸工具运行,但关闭它没有效果,因为我证明了输入确实得到阅读。

brew info tmux
==> tmux: stable 3.3a (bottled), HEAD
Terminal multiplexer
https://tmux.github.io/
/usr/local/Cellar/tmux/HEAD-1536b7e (9 files, 1.1MB)
  Built from source on 2022-12-01 at 10:24:48
/usr/local/Cellar/tmux/3.3a (9 files, 1MB) *
  Poured from bottle on 2022-06-13 at 16:19:33
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/tmux.rb
License: ISC

--------------------------------------
OS: macOS 13.1 22C65 x86_64
Host: MacBookPro16,2
Kernel: 22.2.0
Uptime: 7 days, 4 hours, 14 mins
Packages: 305 (brew), 44 (nix-user)
Shell: fish 3.5.1
Resolution: 2560x1440
DE: Aqua
WM: Rectangle
Terminal: tmux
CPU: Intel i5-1038NG7 (8) @ 2.00GHz
GPU: Intel Iris Plus Graphics
Memory: 13730MiB / 16384MiB

iterm2: 3.4.18 (auto_updates)
https://www.iterm2.com/
Not installed
From: https://github.com/Homebrew/homebrew-cask/blob/HEAD/Casks/iterm2.rb
0md85ypi

0md85ypi1#

键绑定适用于单一模式。默认模式是“default”,它对应于使用vi键绑定时的正常模式。这就是为什么绑定在插入模式下不起作用的原因。
要在插入模式下添加此绑定:

bind -M insert \cf accept-autosuggestion

如果要在正常模式和插入模式下使用:

bind -M default \cf accept-autosuggestion
bind -M insert \cf accept-autosuggestion

相关问题