iTerm2 在 vi​​ 中打开命令响应 like window

iTerm2 opens command response in vi like window

我安装了 iTerm Build 3.3.9。我已使用以下插件和主题配置 oh-my-zsh

ZSH_THEME="powerlevel10k/powerlevel10k"

ZSH_DISABLE_COMPFIX="true"
plugins=(aws git colored-man-pages colorize github virtualenv pip python osx zsh-syntax-highlighting zsh-completions zsh-autosuggestions django npm zsh-interactive-cd zsh-navigation-tools)

现在有 2 个问题需要解决

  1. 看到 ,我已经写了命令 uptil aws cognito-i,剩下的显示为 autosuggestion。问题是我的设置(可能是主题,但我尝试了多个主题)我无法区分我输入的命令和建议的命令。通常建议的命令应该显得有点暗淡,但它与我写的命令相同 color/opacity。如何解决这个问题

  2. 第二个问题是,每当我 运行 带有 aws cli 的命令(也带有 aws-nuke,响应将以新的 vi 输入 window,即命令被删除,我看到空白 window,每行以 ~ 开头,在 window 的末尾显示 END. 为什么会发生这种情况以及如何解决这个问题

要解决第一个问题,请尝试将 zsh-syntax-highlighting 移动到 plugins 的末尾。来自 zsh-syntax-highlighting FAQ:

Why must zsh-syntax-highlighting.zsh be sourced at the end of the .zshrc file?

zsh-syntax-highlighting.zsh wraps ZLE widgets. It must be sourced after all custom widgets have been created (i.e., after all zle -N calls and after running compinit). Widgets created later will work, but will not update the syntax highlighting.

要解决第二个问题,请在 ~/.zshrc 末尾添加以下内容:

# Use `less` as pager in Zsh.
READNULLCMD=less

# Use `less` as pager in external commands.
export PAGER=less

# This affects every invocation of `less`.
#
#   -i   case-insensitive search unless search string contains uppercase letters
#   -R   color
#   -F   exit if there is less than one page of content
#   -X   keep content on screen after exit
#   -M   show more info at the bottom prompt line
#   -x4  tabs are 4 instead of 8
export LESS=-iRFXMx4