我的终端vim配置没有加载〜/ .zshrc.Zsh是环境登录shell.这种情况的正确配置是什么?
以下是我已采取并已删除的一些措施:
set shell=zsh
(使用zsh作为shell但不提供rc)
set shellcmdflag=-ci
(所有输出暂停)
cat ~/.zshenv
(打开vim时出现很多错误)
$ source ~/.zshrc
从手册:
Run Code Online (Sandbox Code Playgroud)Commands are first read from /etc/zshenv; this cannot be overridden. [...] Commands are then read from $ZDOTDIR/.zshenv. If the shell is a login shell, commands are read from /etc/zprofile and then $ZDOTDIR/.zprofile. Then, if the shell is interactive, commands are read from /etc/zshrc and then $ZDOTDIR/.zshrc. Finally, if the shell is a login shell, /etc/zlogin and $ZDOTDIR/.zlogin are read.
据我所知,
set shell=zsh\ -i
Run Code Online (Sandbox Code Playgroud)
应该管用.
接受的答案不能按预期工作.实际的解决方案应该是将别名和其他~/.zshrc内容放入~/.zshenv.唯一需要的~/.vimrc是set shell=zsh没有任何标志.